Skip to content

Instantly share code, notes, and snippets.

@ryanbuening
ryanbuening / Example.cs
Created June 24, 2022 01:03 — forked from ImsMoon/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();
------------------------------------------------------------------------------------
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true
# C# files
[*.cs]
# Indentation and spacing
indent_style = tab
# New line preferences
public class Result
{
public bool Success { get; private set; }
public string Error { get; private set; }
public bool Failure
{
get { return !Success; }
}
@ryanbuening
ryanbuening / Hotkeys.ahk
Created May 19, 2021 14:11
AutoHotKey Script
; #NoEnv is recommended for performance and compatibility with future AutoHotkey releases.
#NoEnv
; Enable #Warn to assist with detecting common errors.
#Warn
; Recommended for new scripts due to its superior speed and reliability.
SendMode Input
; Ensures a consistent starting directory.