C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Select Query in mongo db in c# using json query
WhatsApp
Shirsendu Nandi
14y
11.2
k
0
0
25
Blog
See MongoDB offers a rich query environment with lots of features.
Queries in MongoDB are represented as JSON-style objects, very much like the documents we actually store in the database.
See the below example
Like sqlserver we have select * from things where x=3 and y=
"foo"
In mongo query we have to write
db.things.find( { x : 3, y :
"foo"
} );
NOw to find all document where j is not equal to 3 and k is greater than 10, you'd query like so:
db.things.find({j: {$ne: 3}, k: {$gt: 10} });
People also reading
Membership not found