When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:
main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}
//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(); | |
------------------------------------------------------------------------------------ |
(C) 2015 by Derek Hunziker, (C) 2017 by AppsOn
As of releasing MongoDB 3.4 and C# Driver v2.4, original cheatsheet by Derek is outdated. In addition, it has some deficiencies like connecting to MongoDB, creating indexes, etc. This updated version works fine with C# Driver v2.4.7 and MongoDB v3.4.
Note: Defined models and collections will be used in entire cheatsheet.