Skip to content

Instantly share code, notes, and snippets.

@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();
------------------------------------------------------------------------------------
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 10, 2024 20:23
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

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;
}
@a3dho3yn
a3dho3yn / mongodb_c#_cheatsheet.md
Last active March 27, 2024 00:04
MongoDB C# Driver Cheat Sheet

MongoDB C# Driver Cheat Sheet

(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.

Setup

Define Document Models

Note: Defined models and collections will be used in entire cheatsheet.