Skip to content

Instantly share code, notes, and snippets.

Avatar

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

View GitHub Profile
@dj-nitehawk
dj-nitehawk / Program.cs
Last active Apr 7, 2020
one-to-many entity relationship example
View Program.cs
using MongoDB.Driver;
using MongoDB.Entities;
using MongoDB.Entities.Core;
using System.Linq;
namespace EntityModels
{
public class Author : Entity
{
public string Name { get; set; }
@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; }
@dj-nitehawk
dj-nitehawk / Program.cs
Last active Mar 13, 2020
filter by month number using aggregation pipeline
View Program.cs
using MongoDB.Driver;
using MongoDB.Entities;
using MongoDB.Entities.Core;
using System;
namespace StackOverFlow
{
public class Item : Entity
{
public DateTime DateOfCreation { get; set; }
@dj-nitehawk
dj-nitehawk / Program.cs
Created Mar 12, 2020
update with aggregation pipeline stage
View Program.cs
using MongoDB.Entities;
using MongoDB.Entities.Core;
using System;
namespace StackOverFlow
{
public class UnitTravelHistory : Entity
{
public long JobDuration { get; set; }
public DateTime Start { get; set; }
@dj-nitehawk
dj-nitehawk / Program.cs
Last active Mar 9, 2020
string template example - lookup pipeline
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 StackOverFlow
{
public class Channel : Entity
@dj-nitehawk
dj-nitehawk / Program.cs
Last active Mar 9, 2020
aggregate - match > sort > group > replacewith
View Program.cs
using MongoDB.Driver;
using MongoDB.Entities;
using MongoDB.Entities.Core;
using System;
using System.Linq;
namespace StackOverFlow
{
public class Product : Entity
{
You can’t perform that action at this time.