Show / Hide Table of Contents

    Class MongoClient.Database

    An object representing a remote MongoDB database.

    Inheritance
    Object
    MongoClient.Database
    Namespace: Realms.Sync
    Assembly: Realm.dll
    Syntax
    public class Database

    Properties

    | Improve this Doc View Source

    Client

    Gets the MongoClient that manages this database.

    Declaration
    public MongoClient Client { get; }
    Property Value
    Type Description
    MongoClient

    The database's MongoClient.

    | Improve this Doc View Source

    Name

    Gets the name of the database.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    String

    The database name.

    Methods

    | Improve this Doc View Source

    GetCollection(String)

    Gets a collection from the database.

    Declaration
    public MongoClient.Collection<BsonDocument> GetCollection(string name)
    Parameters
    Type Name Description
    String name

    The name of the collection.

    Returns
    Type Description
    MongoClient.Collection<MongoDB.Bson.BsonDocument>

    A MongoClient.Collection<TDocument> instance that exposes an API for CRUD operations on its contents.

    | Improve this Doc View Source

    GetCollection<TDocument>(String)

    Gets a collection from the database.

    Declaration
    public MongoClient.Collection<TDocument> GetCollection<TDocument>(string name)
    
        where TDocument : class
    Parameters
    Type Name Description
    String name

    The name of the collection.

    Returns
    Type Description
    MongoClient.Collection<TDocument>

    A MongoClient.Collection<TDocument> instance that exposes an API for CRUD operations on its contents.

    Type Parameters
    Name Description
    TDocument

    The managed type that matches the shape of the documents in the collection.

    Remarks

    The MongoDB Bson library is used to decode the response. It will automatically handle most cases, but if you want to control the behavior of the deserializer, you can use the attributes in the MongoDB.Bson.Serialization.Attributes namespace.
    If you want to modify the global conventions used when deserializing the response, such as convert camelCase properties to PascalCase, you can register a ConventionPack.

    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Realm
    Generated by DocFX