Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

where with multiple conditions in mongodb

-- mongodb
db.people.find(
    { status: "A",
      age: 50 }
)
-- sql
SELECT *
FROM people
WHERE status = "A"
AND age = 50

-- mongodb
db.people.find(
    { $or: [ { status: "A" } , { age: 50 } ] }
)
-- sql
SELECT *
FROM people
WHERE status = "A"
OR age = 50
Source by www.mongodb.com #
 
PREVIOUS NEXT
Tagged: #multiple #conditions #mongodb
ADD COMMENT
Topic
Name
4+2 =