• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help with syntax

 
David Spades
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a collection like so:


I want to print just the name of users who doesn't have any address located in suburb "ashfield", in this case, only user 2 is qualified.
User 1 fails since his billing address is in ashfield, and user 3 fails because his school is in ashfield. How would the query look in mongodb?
thanks
 
chris webster
Bartender
Posts: 2407
33
Linux Oracle Postgres Database Python Scala
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can find lots of query examples on the MongoDB website. The $not and $ne operators will probably come in handy.

The free online courses in MongoDB for programmers are starting again about now. I would strongly recommend you take one of these as it's a great way to get up to speed with MongoDB.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic