These are chat archives for Automattic/mongoose

22nd
Jun 2017
Ben Chiciudean
@benydc
Jun 22 2017 11:48
How can query for 2234 against a collection?
{
  "_id": idvalue,
  "author":{
    "firstname":"Daniel",
    "lastname": "Defoe"
  },
  "books":[
    {
      "2234"
      "1714"
    }
  ]
}

I tried but no joy:

collection.find({ books: "2234"})

and

collection.findOne({ books: "2234"})
Reis
@mreis1
Jun 22 2017 19:44
@benydc there’s no reason for that. It should work. Try using the mongo shell to run the query.