Mongo Management Studio Download Mac Average ratng: 5,6/10 4542 votes
  1. Mongo Management Studio Download Mac Download
  2. Mongo Management Studio Download Mac Os
  3. Mongo Download Center
  4. Mongo Management Studio Download
  5. Mongo Management Studio

Mongo Management Studio 1.9.3. Improve your overall browsing experience and replace Safari on your Mac. Google Chrome. Fast and user-friendly web browser that helps you navigate the Internet while also allowing you to stay safe and to synchronize your bookmarks between multiple computers. Trusted Windows (PC) download Mongo Management Studio 1.6.0. Virus-free and 100% clean download. Get Mongo Management Studio alternative downloads. Download Mongo Management Studio - Provides you with a streamlined environment and a useful set of tools to work on multiple local databases found on Node.js, MongoDB or Redis servers. Studio 3T is an integrated development environment designed especially for teams.

-->

By Pratik Khandelwal and Scott Addie

This tutorial creates a web API that performs Create, Read, Update, and Delete (CRUD) operations on a MongoDB NoSQL database.

In this tutorial, you learn how to:

  • Configure MongoDB
  • Create a MongoDB database
  • Define a MongoDB collection and schema
  • Perform MongoDB CRUD operations from a web API
  • Customize JSON serialization

View or download sample code (how to download)

Prerequisites

  • Visual Studio 2019 with the ASP.NET and web development workload

Configure MongoDB

If using Windows, MongoDB is installed at C:Program FilesMongoDB by default. Add C:Program FilesMongoDBServer<version_number>bin to the Path environment variable. This change enables MongoDB access from anywhere on your development machine.

Use the mongo Shell in the following steps to create a database, make collections, and store documents. For more information on mongo Shell commands, see Working with the mongo Shell.

  1. Choose a directory on your development machine for storing the data. For example, C:BooksData on Windows. Create the directory if it doesn't exist. The mongo Shell doesn't create new directories.

  2. Open a command shell. Run the following command to connect to MongoDB on default port 27017. Remember to replace <data_directory_path> with the directory you chose in the previous step.

  3. Open another command shell instance. Connect to the default test database by running the following command:

  4. Run the following in a command shell:

    If it doesn't already exist, a database named BookstoreDb is created. If the database does exist, its connection is opened for transactions.

  5. Create a Books collection using following command:

    The following result is displayed:

  6. Define a schema for the Books collection and insert two documents using the following command:

    The following result is displayed:

    Note

    The ID's shown in this article will not match the IDs when you run this sample.

  7. View the documents in the database using the following command:

    The following result is displayed:

    The schema adds an autogenerated _id property of type ObjectId for each document.

The database is ready. You can start creating the ASP.NET Core web API.

Create the ASP.NET Core web API project

  1. Go to File > New > Project.

  2. Select the ASP.NET Core Web Application project type, and select Next.

  3. Name the project BooksApi, and select Create.

  4. Select the .NET Core target framework and ASP.NET Core 3.0. Select the API project template, and select Create.

  5. Visit the NuGet Gallery: MongoDB.Driver to determine the latest stable version of the .NET driver for MongoDB. In the Package Manager Console window, navigate to the project root. Run the following command to install the .NET driver for MongoDB:

  1. Run the following commands in a command shell:

    A new ASP.NET Core web API project targeting .NET Core is generated and opened in Visual Studio Code.

  2. After the status bar's OmniSharp flame icon turns green, a dialog asks Required assets to build and debug are missing from 'BooksApi'. Add them?. Select Yes.

  3. Visit the NuGet Gallery: MongoDB.Driver to determine the latest stable version of the .NET driver for MongoDB. Open Integrated Terminal and navigate to the project root. Run the following command to install the .NET driver for MongoDB:

  1. In Visual Studio for Mac earlier than version 8.6, select File > New Solution > .NET Core > App from the sidebar. In version 8.6 or later, select File > New Solution > Web and Console > App from the sidebar.
  2. Select the ASP.NET Core > API C# project template, and select Next.
  3. Select .NET Core 3.1 from the Target Framework drop-down list, and select Next.
  4. Enter BooksApi for the Project Name, and select Create.
  5. In the Solution pad, right-click the project's Dependencies node and select Add Packages.
  6. Enter MongoDB.Driver in the search box, select the MongoDB.Driver package, and select Add Package.
  7. Select the Accept button in the License Acceptance dialog.

Add an entity model

  1. Add a Models directory to the project root.

  2. Add a Book class to the Models directory with the following code:

    In the preceding class, the Id property:

    • Is required for mapping the Common Language Runtime (CLR) object to the MongoDB collection.
    • Is annotated with [BsonId] to designate this property as the document's primary key.
    • Is annotated with [BsonRepresentation(BsonType.ObjectId)] to allow passing the parameter as type string instead of an ObjectId structure. Mongo handles the conversion from string to ObjectId.

    The BookName property is annotated with the [BsonElement] attribute. The attribute's value of Name represents the property name in the MongoDB collection.

Add a configuration model

  1. Add the following database configuration values to appsettings.json:

  2. Add a BookstoreDatabaseSettings.cs file to the Models directory with the following code:

    The preceding BookstoreDatabaseSettings class is used to store the appsettings.json file's BookstoreDatabaseSettings property values. The JSON and C# property names are named identically to ease the mapping process.

  3. Add the following highlighted code to Startup.ConfigureServices:

    In the preceding code:

    • The configuration instance to which the appsettings.json file's BookstoreDatabaseSettings section binds is registered in the Dependency Injection (DI) container. For example, a BookstoreDatabaseSettings object's ConnectionString property is populated with the BookstoreDatabaseSettings:ConnectionString property in appsettings.json.
    • The IBookstoreDatabaseSettings interface is registered in DI with a singleton service lifetime. When injected, the interface instance resolves to a BookstoreDatabaseSettings object.
  4. Add the following code to the top of Startup.cs to resolve the BookstoreDatabaseSettings and IBookstoreDatabaseSettings references:

Add a CRUD operations service

  1. Add a Services directory to the project root.

  2. Add a BookService class to the Services directory with the following code:

    In the preceding code, an IBookstoreDatabaseSettings instance is retrieved from DI via constructor injection. This technique provides access to the appsettings.json configuration values that were added in the Add a configuration model section.

  3. Add the following highlighted code to Startup.ConfigureServices:

    In the preceding code, the BookService class is registered with DI to support constructor injection in consuming classes. The singleton service lifetime is most appropriate because BookService takes a direct dependency on MongoClient. Per the official Mongo Client reuse guidelines, MongoClient should be registered in DI with a singleton service lifetime.

  4. Add the following code to the top of Startup.cs to resolve the BookService reference:

The BookService class uses the following MongoDB.Driver members to perform CRUD operations against the database:

  • MongoClient: Reads the server instance for performing database operations. The constructor of this class is provided the MongoDB connection string:

  • IMongoDatabase: Represents the Mongo database for performing operations. This tutorial uses the generic GetCollection<TDocument>(collection) method on the interface to gain access to data in a specific collection. Perform CRUD operations against the collection after this method is called. In the GetCollection<TDocument>(collection) method call:

    • collection represents the collection name.
    • TDocument represents the CLR object type stored in the collection.

GetCollection<TDocument>(collection) returns a MongoCollection object representing the collection. In this tutorial, the following methods are invoked on the collection:

  • DeleteOne: Deletes a single document matching the provided search criteria.
  • Find<TDocument>: Returns all documents in the collection matching the provided search criteria.
  • InsertOne: Inserts the provided object as a new document in the collection.
  • ReplaceOne: Replaces the single document matching the provided search criteria with the provided object.

Add a controller

Add a BooksController class to the Controllers directory with the following code:

The preceding web API controller:

  • Uses the BookService class to perform CRUD operations.
  • Contains action methods to support GET, POST, PUT, and DELETE HTTP requests.
  • Calls CreatedAtRoute in the Create action method to return an HTTP 201 response. Status code 201 is the standard response for an HTTP POST method that creates a new resource on the server. CreatedAtRoute also adds a Location header to the response. The Location header specifies the URI of the newly created book.

Test the web API

  1. Build and run the app.

  2. Navigate to http://localhost:<port>/api/books to test the controller's parameterless Get action method. The following JSON response is displayed:

  3. Navigate to http://localhost:<port>/api/books/{id here} to test the controller's overloaded Get action method. The following JSON response is displayed:

Configure JSON serialization options

There are two details to change about the JSON responses returned in the Test the web API section:

Mongo Management Studio Download Mac Download

  • The property names' default camel casing should be changed to match the Pascal casing of the CLR object's property names.
  • The bookName property should be returned as Name.

To satisfy the preceding requirements, make the following changes:

  1. JSON.NET has been removed from ASP.NET shared framework. Add a package reference to Microsoft.AspNetCore.Mvc.NewtonsoftJson.

  2. In Startup.ConfigureServices, chain the following highlighted code on to the AddControllers method call:

    With the preceding change, property names in the web API's serialized JSON response match their corresponding property names in the CLR object type. For example, the Book class's Author property serializes as Author.

  3. In Models/Book.cs, annotate the BookName property with the following [JsonProperty] attribute:

    The [JsonProperty] attribute's value of Name represents the property name in the web API's serialized JSON response.

  4. Add the following code to the top of Models/Book.cs to resolve the [JsonProperty] attribute reference:

  5. Repeat the steps defined in the Test the web API section. Notice the difference in JSON property names.

This tutorial creates a web API that performs Create, Read, Update, and Delete (CRUD) operations on a MongoDB NoSQL database.

In this tutorial, you learn how to:

  • Configure MongoDB
  • Create a MongoDB database
  • Define a MongoDB collection and schema
  • Perform MongoDB CRUD operations from a web API
  • Customize JSON serialization

View or download sample code (how to download)

Prerequisites

  • Visual Studio 2019 with the ASP.NET and web development workload

Configure MongoDB

If using Windows, MongoDB is installed at C:Program FilesMongoDB by default. Add C:Program FilesMongoDBServer<version_number>bin to the Path environment variable. This change enables MongoDB access from anywhere on your development machine.

Use the mongo Shell in the following steps to create a database, make collections, and store documents. For more information on mongo Shell commands, see Working with the mongo Shell.

  1. Choose a directory on your development machine for storing the data. For example, C:BooksData on Windows. Create the directory if it doesn't exist. The mongo Shell doesn't create new directories.

  2. Open a command shell. Run the following command to connect to MongoDB on default port 27017. Remember to replace <data_directory_path> with the directory you chose in the previous step.

  3. Open another command shell instance. Connect to the default test database by running the following command:

  4. Run the following in a command shell:

    If it doesn't already exist, a database named BookstoreDb is created. If the database does exist, its connection is opened for transactions.

  5. Create a Books collection using following command:

    The following result is displayed:

  6. Define a schema for the Books collection and insert two documents using the following command:

    The following result is displayed:

    Note

    The ID's shown in this article will not match the IDs when you run this sample.

  7. View the documents in the database using the following command:

    The following result is displayed:

    The schema adds an autogenerated _id property of type ObjectId for each document.

The database is ready. You can start creating the ASP.NET Core web API.

Create the ASP.NET Core web API project

  1. Go to File > New > Project.

  2. Select the ASP.NET Core Web Application project type, and select Next.

  3. Name the project BooksApi, and select Create.

  4. Select the .NET Core target framework and ASP.NET Core 2.2. Select the API project template, and select Create.

  5. Visit the NuGet Gallery: MongoDB.Driver to determine the latest stable version of the .NET driver for MongoDB. In the Package Manager Console window, navigate to the project root. Run the following command to install the .NET driver for MongoDB:

  1. Run the following commands in a command shell:

    A new ASP.NET Core web API project targeting .NET Core is generated and opened in Visual Studio Code.

  2. After the status bar's OmniSharp flame icon turns green, a dialog asks Required assets to build and debug are missing from 'BooksApi'. Add them?. Select Yes.

  3. Visit the NuGet Gallery: MongoDB.Driver to determine the latest stable version of the .NET driver for MongoDB. Open Integrated Terminal and navigate to the project root. Run the following command to install the .NET driver for MongoDB:

  1. In Visual Studio for Mac earlier than version 8.6, select File > New Solution > .NET Core > App from the sidebar. In version 8.6 or later, select File > New Solution > Web and Console > App from the sidebar.
  2. Select the ASP.NET Core Web API C# project template, and select Next.
  3. Select .NET Core 2.2 from the Target Framework drop-down list, and select Next.
  4. Enter BooksApi for the Project Name, and select Create.
  5. In the Solution pad, right-click the project's Dependencies node and select Add Packages.
  6. Enter MongoDB.Driver in the search box, select the MongoDB.Driver package, and select Add Package.
  7. Select the Accept button in the License Acceptance dialog.

Add an entity model

  1. Add a Models directory to the project root.

  2. Add a Book class to the Models directory with the following code:

    In the preceding class, the Id property:

    • Is required for mapping the Common Language Runtime (CLR) object to the MongoDB collection.
    • Is annotated with [BsonId] to designate this property as the document's primary key.
    • Is annotated with [BsonRepresentation(BsonType.ObjectId)] to allow passing the parameter as type string instead of an ObjectId structure. Mongo handles the conversion from string to ObjectId.

    The BookName property is annotated with the [BsonElement] attribute. The attribute's value of Name represents the property name in the MongoDB collection.

Add a configuration model

  1. Add the following database configuration values to appsettings.json:

  2. Add a BookstoreDatabaseSettings.cs file to the Models directory with the following code:

    The preceding BookstoreDatabaseSettings class is used to store the appsettings.json file's BookstoreDatabaseSettings property values. The JSON and C# property names are named identically to ease the mapping process.

  3. Add the following highlighted code to Startup.ConfigureServices:

    In the preceding code:

    • The configuration instance to which the appsettings.json file's BookstoreDatabaseSettings section binds is registered in the Dependency Injection (DI) container. For example, a BookstoreDatabaseSettings object's ConnectionString property is populated with the BookstoreDatabaseSettings:ConnectionString property in appsettings.json.
    • The IBookstoreDatabaseSettings interface is registered in DI with a singleton service lifetime. When injected, the interface instance resolves to a BookstoreDatabaseSettings object.
  4. Add the following code to the top of Startup.cs to resolve the BookstoreDatabaseSettings and IBookstoreDatabaseSettings references:

Add a CRUD operations service

  1. Add a Services directory to the project root.

  2. Add a BookService class to the Services directory with the following code:

    In the preceding code, an IBookstoreDatabaseSettings instance is retrieved from DI via constructor injection. This technique provides access to the appsettings.json configuration values that were added in the Add a configuration model section.

  3. Add the following highlighted code to Startup.ConfigureServices:

    In the preceding code, the BookService class is registered with DI to support constructor injection in consuming classes. The singleton service lifetime is most appropriate because BookService takes a direct dependency on MongoClient. Per the official Mongo Client reuse guidelines, MongoClient should be registered in DI with a singleton service lifetime.

  4. Add the following code to the top of Startup.cs to resolve the BookService reference:

Mongo management studio download

The BookService class uses the following MongoDB.Driver members to perform CRUD operations against the database:

  • MongoClient: Reads the server instance for performing database operations. The constructor of this class is provided the MongoDB connection string:

  • IMongoDatabase: Represents the Mongo database for performing operations. This tutorial uses the generic GetCollection<TDocument>(collection) method on the interface to gain access to data in a specific collection. Perform CRUD operations against the collection after this method is called. In the GetCollection<TDocument>(collection) method call:

    • collection represents the collection name.
    • TDocument represents the CLR object type stored in the collection.

GetCollection<TDocument>(collection) returns a MongoCollection object representing the collection. In this tutorial, the following methods are invoked on the collection:

  • DeleteOne: Deletes a single document matching the provided search criteria.
  • Find<TDocument>: Returns all documents in the collection matching the provided search criteria.
  • InsertOne: Inserts the provided object as a new document in the collection.
  • ReplaceOne: Replaces the single document matching the provided search criteria with the provided object.

Add a controller

Add a BooksController class to the Controllers directory with the following code:

The preceding web API controller:

  • Uses the BookService class to perform CRUD operations.
  • Contains action methods to support GET, POST, PUT, and DELETE HTTP requests.
  • Calls CreatedAtRoute in the Create action method to return an HTTP 201 response. Status code 201 is the standard response for an HTTP POST method that creates a new resource on the server. CreatedAtRoute also adds a Location header to the response. The Location header specifies the URI of the newly created book.

Test the web API

  1. Build and run the app.

  2. Navigate to http://localhost:<port>/api/books to test the controller's parameterless Get action method. The following JSON response is displayed:

  3. Navigate to http://localhost:<port>/api/books/{id here} to test the controller's overloaded Get action method. The following JSON response is displayed:

Configure JSON serialization options

There are two details to change about the JSON responses returned in the Test the web API section:

  • The property names' default camel casing should be changed to match the Pascal casing of the CLR object's property names.
  • The bookName property should be returned as Name.

To satisfy the preceding requirements, make the following changes:

  1. In Startup.ConfigureServices, chain the following highlighted code on to the AddMvc method call:

    With the preceding change, property names in the web API's serialized JSON response match their corresponding property names in the CLR object type. For example, the Book class's Author property serializes as Author.

  2. In Models/Book.cs, annotate the BookName property with the following [JsonProperty] attribute:

    The [JsonProperty] attribute's value of Name represents the property name in the web API's serialized JSON response.

  3. Add the following code to the top of Models/Book.cs to resolve the [JsonProperty] attribute reference:

  4. Repeat the steps defined in the Test the web API section. Notice the difference in JSON property names.

Add authentication support to a web API

ASP.NET Core Identity adds user interface (UI) login functionality to ASP.NET Core web apps. To secure web APIs and SPAs, use one of the following:

  • Azure Active Directory B2C (Azure AD B2C)

IdentityServer4 is an OpenID Connect and OAuth 2.0 framework for ASP.NET Core. IdentityServer4 enables the following security features:

  • Authentication as a Service (AaaS)
  • Single sign-on/off (SSO) over multiple application types
  • Access control for APIs
  • Federation Gateway

For more information, see Welcome to IdentityServer4.

Next steps

For more information on building ASP.NET Core web APIs, see the following resources:

  • Download
The program can not be downloaded: the download link is not available.External download links have become invalid for an unknown reason.Sorry, but we cannot ensure safeness of third party websites.

Often downloaded with

Mongo Management Studio Download Mac Os

  • Scarytales: All Hail King MongoScarytales: All Hail King Mongo is a neat, easy to play hidden object game. The...$9.99DOWNLOAD
  • DeskCenter Management StudioDeskCenter Management Studio allows you to deal with all administrative...DOWNLOAD
  • Microsoft SQL Server Metadata-Driven ETL Management Studio (x86)Originally an internal MSIT solution that has been released as an open source...DOWNLOAD
  • SQL Management Studio for MySQLThis is a complete solution for MySQL database administration and development....$655DOWNLOAD
  • Visual Studio Dependencies ManagerVisual Studio extension enables you to share and manage your binary...DOWNLOAD
SellingPoint Management Studio

Bookkeeping-Cataloging

EMS SQL Management Studio for InterBase/Firebird

Mongo Download Center

Database Tools

Mongo Management Studio Download

EMS SQL Management Studio for SQL Server

Distribution

SQL Management Studio for PostgreSQL

Mongo Management Studio

Database Tools

Coments are closed
Scroll to top