Skip to content

Instantly share code, notes, and snippets.

View ImsMoon's full-sized avatar
🎯
Focusing

Imtiyaz Moon ImsMoon

🎯
Focusing
View GitHub Profile
@ImsMoon
ImsMoon / Example.cs
Created September 6, 2021 10:15 — forked from JaykeOps/Example.cs
Mongo C# Driver CRUD CheatSheet
//Read
//BsonDocument
var collection = db.GetCollection<BsonDocument>("people");
var builder = Builders<BsonDocument>.Filter;
//Note that the '&' '!' '|' operators are overloaded when used in the FilterBuilder
var filter = builder.Lt("Age", 33) & !builder.Eq("Name", "Ericsson");
var list = await collection.Find(filter).ToListAsync();
------------------------------------------------------------------------------------
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package testsubject;
import java.io.*;
import java.util.*;
/**
*