How to create doesNotContain query using incasesensitive behavior using java mongo driver

5 views
Skip to first unread message

Yogesh Yadav

unread,
Jan 9, 2017, 3:27:10 PM1/9/17
to mongodb-dev, yogesh yadav
Hi, 

I am pretty new to MongoDb. However I wanted to create following queries with incasesensitive behavior using java mongo driver 

1) 'doesNotContain' query:
Similar to following mongo query Ex: db.mydb.find({"myfield" :{$not:  /myvalue/i}})
This query should return records where 'myfield' does not contains 'myvalue'

2) Exact match or equal query:
Ex: db.mydb.find({"myfield" :"myvalue"})
This query should return records where 'myfield' completely matched with 'myvalue' but with incasesensitive behavior

Please suggest 

Thanks,
Yogesh Yadav
Reply all
Reply to author
Forward
0 new messages