Page History
...
MongoDB | ADS MongoSQL |
---|---|
db.baseball.find( { city: { $in: [ "New York", "Chicago" ] } } ) Note: $in selects the documents where the field value equals any value in the specified list. | SELECT * FROM baseball WHERE city IN ( 'New York', 'Chicago') or SELECT * FROM baseball WHERE city = 'New York' OR city = 'Chicago' |
db.baseball.find( { worldChampionships: { $exists: true, $gt: 10 } } ) Note: This query returns all documents where the worldChampionships field exists and its value > 10. | SELECT * FROM baseball WHERE FIELD_EXISTS(worldChampionships) AND worldChampionships > 10 |
db.baseball.find( { worldChampionships: { $exists: false } } ) Note: This query returns all documents that do not contain the worldChampionships field. | SELECT * FROM baseball WHERE NOT FIELD_EXISTS(worldChampionships) |
db.baseball.find( ... ).explain() | EXPLAIN SELECT * FROM baseball ... |
INSERT Support
...