Reputation: 63
I am trying to use "$and" operator in Haskell mongoDB which is not working:
myFilter = do
cursor <- MongoDB.find (MongoDB.select ["$and" =: [["field1" =: "test1"], ["field2" =: "test2"], ["field3" =: "test3"]]], "db")
rest cursor
Thanks in advance.
Upvotes: 0
Views: 176
Reputation: 6249
You have an unnecessary comma before "db" which is causing a type error.
Try this:
myFilter = do
cursor <- MongoDB.find (MongoDB.select ["$and" =: [["field1" =: "test1"], ["field2" =: "test2"], ["field3" =: "test3"]]] "db")
rest cursor
Note:
Upvotes: 3