# Add case-insensitive exact lookup to ArrayField?

**URL:** <https://forum.djangoproject.com/t/add-case-insensitive-exact-lookup-to-arrayfield/17565>\
**Category:** ORM\
**Created:** [December 12, 2022, 10:42am UTC](https://forum.djangoproject.com/t/add-case-insensitive-exact-lookup-to-arrayfield/17565 "2022-12-12T10:42:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdolemelipone](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/sdolemelipone/32/2666_2.png) [@sdolemelipone](https://forum.djangoproject.com/u/sdolemelipone)\
**Post date:** [December 12, 2022, 10:42am UTC](https://forum.djangoproject.com/t/add-case-insensitive-exact-lookup-to-arrayfield/17565/1 "2022-12-12T10:42:32Z")

</div>

Hello all,

I’ve been using [django.contrib.postgres.fields.ArrayField](https://docs.djangoproject.com/en/4.0/ref/contrib/postgres/fields/) in a project and wanted to perform a case-insensitive exact lookup on any of the elements of the array field. Is this something that would be worth adding? I’d be happy to work on a ticket/PR.

Example:

```python
class Biscuit(models.Model):
    name = models.CharField(max_length=80)
    ingredients = ArrayField(base_field=models.CharField(max_length=80))
    
    def __str__ (self):
        return self.name

>>> Biscuit.objects.create(name="Bourbon", ingredients=["Cocoa", "Butter"])
>>> Biscuit.objects.create(name="Breakaway", ingredients=["Cocoa-solids", "Flour"])

```

Current functionality:

```python
>>> Biscuit.objects.filter(ingredients__icontains=["cocoa"])
<Queryset []>
>>> Biscuit.objects.filter(ingredients__icontains="cocoa")
<Queryset [<Biscuit: Breakaway>, <Biscuit: Bourbon>]>
>>> Biscuit.objects.filter(ingredients__contains=["Cocoa"])
<Queryset [<Biscuit: Bourbon>]>

```

Desired functionality:

```python
>>> Biscuit.objects.filter(ingredients__icontains=["cocoa"])
<Queryset [<Biscuit: Bourbon>]>

```

Thanks  
Mark
