Giter Club home page Giter Club logo

chsakell-mongodb-csharp's Introduction

MongoDB C# docs

MongoDB for C# developers

  • Repository for the MongoDB C# docs gitbook
  • Build MongoDB queries using the MongoDB C# driver
  • Operators explanations with examples written in C# and node.js (shell)
  • Advanced querying using LINQ

Gitbook ๐Ÿ“˜

The docs contain code samples for building MongoDB queries using the MongoDB C# driver an a typed way rather than using BsonDocument.

Example - $unwind operator ๐Ÿšฉ

var travelersQueryableCollection = tripsDatabase
    .GetCollection<Traveler>(Constants.TravelersCollection)
    .AsQueryable();

var linqQuery = travelersQueryableCollection
    .SelectMany(t => t.Activities, (t, a) => new
    {
        age = t.Age,
        activity = a
    })
    .GroupBy(q => q.age)
    .Select(g => new { age = g.Key, activities = 
        g.Select(a => a.activity).Distinct() })
    .OrderBy(r => r.age);

var linqQueryResults = await linqQuery.ToListAsync();

Contributing โ˜•

The docs are ofted updated with new samples but you are free to contribute as well. There are two options to do so:

  • Option 1

    • ๐Ÿ’ก Suggest a sample to be added on the docs. Make sure you have done your search either in the docs or the source code before opening the issue. Add some sample data to explain exactly what you are looking for. The issue's title for new samples should have the format Request sample - <short-description>, for example Request sample - add array element
  • Option 2

    • Fix a sample in the docs. ๐Ÿด Fork this repo and open a pull request

License

License

chsakell-mongodb-csharp's People

Contributors

chsakell avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.