Skip to content

Instantly share code, notes, and snippets.

Avatar

Đĵ ΝιΓΞΗΛψΚ dj-nitehawk

View GitHub Profile
@dj-nitehawk
dj-nitehawk / Program.cs
Created Feb 5, 2021
resume token demo for watcher/change-stream
View Program.cs
using MongoDB.Bson;
using MongoDB.Entities;
using System;
using System.IO;
using System.Threading.Tasks;
namespace TestApplication
{
public class Book : Entity
{
@dj-nitehawk
dj-nitehawk / Program.cs
Created Dec 12, 2020
lookup one to many relationship
View Program.cs
using MongoDB.Driver;
using MongoDB.Driver.Linq;
using MongoDB.Entities;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace TestApplication
{
public class Course : Entity
@dj-nitehawk
dj-nitehawk / Program.cs
Created Nov 26, 2020
reverse relationship access with many-to-many relationship
View Program.cs
using MongoDB.Driver;
using MongoDB.Driver.Linq;
using MongoDB.Entities;
using System.Linq;
using System.Threading.Tasks;
namespace TestApplication
{
public class User : Entity
{
View Program.cs
using MongoDB.Entities;
using System;
using System.Threading.Tasks;
namespace TestProg
{
internal static class Program
{
public class ArtGallery : Entity
{
@dj-nitehawk
dj-nitehawk / Program.cs
Created Jul 3, 2020
deeply nested shitstorm ;-)
View Program.cs
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Driver;
using MongoDB.Entities;
using MongoDB.Entities.Core;
using System.Linq;
namespace TestApp
{
public class Team : Entity
View Program.cs
using MongoDB.Entities;
using MongoDB.Entities.Core;
using System.Collections.Generic;
using System.Linq;
namespace TestApp
{
public class Zone : Entity
{
public int SqlId { get; set; }
@dj-nitehawk
dj-nitehawk / Program.cs
Last active Nov 13, 2020
one-to-many entity relationship example
View Program.cs
using MongoDB.Driver;
using MongoDB.Driver.Linq;
using MongoDB.Entities;
using System.Linq;
using System.Threading.Tasks;
namespace ReferencedRelationshipExample
{
public class Author : Entity
{
@dj-nitehawk
dj-nitehawk / Program.cs
Created Mar 19, 2020
aggregation pipeline with multiple unwinds and replaceWith
View Program.cs
using MongoDB.Bson;
using MongoDB.Driver;
using MongoDB.Entities;
using MongoDB.Entities.Core;
using System.Linq;
namespace StackOverFlow
{
public class OptionMenu : Entity
{
@dj-nitehawk
dj-nitehawk / Program.cs
Created Mar 16, 2020
find records that matches a nested array element
View Program.cs
using MongoDB.Entities;
using MongoDB.Entities.Core;
using System;
using System.Linq;
namespace StackOverFlow
{
public class AutoSave : Entity
{
public string[] Templates { get; set; }
@dj-nitehawk
dj-nitehawk / Program.cs
Created Mar 14, 2020
find query with filter > sort > limit > project
View Program.cs
using MongoDB.Entities;
using MongoDB.Entities.Core;
using System.Linq;
namespace StackOverFlow
{
public class Item : Entity
{
public int a { get; set; }
public int b { get; set; }