- Install MongoDB Community Edition on macOS¶
- Overview¶
- MongoDB Version¶
- Considerations¶
- Platform Support¶
- Production Notes¶
- Install MongoDB Community Edition¶
- Prerequisites¶
- Install Xcode Command-Line Tools¶
- Install Homebrew¶
- Installing MongoDB 5.0 Community Edition¶
- Run MongoDB Community Edition¶
- Connect and Use MongoDB¶
- Using the MongoDB Database Tools¶
- Additional Information¶
- Localhost Binding by Default¶
- Troubleshooting ChecksumMismatchError¶
- Release Notes¶
- MongoDB Compass 1.28.4В¶
- MongoDB Compass 1.28.1В¶
- MongoDB Compass 1.26.1В¶
- MongoDB Compass 1.26.0В¶
- MongoDB Compass 1.25.0В¶
- MongoDB Compass 1.24.1В¶
- MongoDB Compass 1.23В¶
- MongoDB Compass 1.22В¶
- MongoDB Compass 1.21В¶
- MongoDB Compass 1.20В¶
- MongoDB Compass 1.19В¶
- MongoDB Compass 1.18В¶
- MongoDB Compass 1.17В¶
- MongoDB Compass 1.16В¶
- MongoDB Compass 1.15В¶
- MongoDB Compass 1.14В¶
- MongoDB Compass 1.13В¶
- MongoDB Compass 1.12В¶
- MongoDB Compass 1.11В¶
- MongoDB Compass 1.10В¶
- MongoDB Compass 1.9В¶
- MongoDB Compass 1.8В¶
- MongoDB Compass 1.7В¶
- MongoDB Compass 1.6В¶
- MongoDB Compass 1.5В¶
- MongoDB Compass 1.4В¶
- MongoDB Compass 1.3В¶
- 1.3.0-beta.3 — July 12, 2016В¶
- 1.3.0-beta.2 — June 29, 2016В¶
- 1.3.0-beta.0 — June 27, 2016В¶
- MongoDB Compass 1.2В¶
- 1.2.0-beta.3 — June 23, 2016В¶
- 1.2.0-beta.2 — June 1, 2016В¶
- 1.2.0-beta.1 — May 10, 2016В¶
- MongoDB Compass 1.1В¶
- 1.1.1 — Jan 19, 2016В¶
- MongoDB Compass 1.0В¶
Install MongoDB Community Edition on macOS¶
MongoDB Atlas is a hosted MongoDB service option in the cloud which requires no installation overhead and offers a free tier to get started.
Overview¶
Use this tutorial to install MongoDB 5.0 Community Edition on macOS using the third-party Homebrew package manager.
Starting with MongoDB 4.4.1, installing MongoDB via Homebrew also installs the MongoDB Database Tools. See Using the MongoDB Database Tools for more information.
MongoDB Version¶
This tutorial installs MongoDB 5.0 Community Edition. To install a different version of MongoDB Community , use the version drop-down menu in the upper-left corner of this page to select the documentation for that version.
Considerations¶
Platform Support¶
- MongoDB 5.0 Community Edition removes support for macOS 10.13
MongoDB 5.0 Community Edition supports macOS 10.14 or later.
See Supported Platforms for more information.
Production Notes¶
Before deploying MongoDB in a production environment, consider the Production Notes document which offers performance considerations and configuration recommendations for production MongoDB deployments.
Install MongoDB Community Edition¶
Prerequisites¶
Ensure your system meets each of the following prerequisites. You only need to perform each prerequisite step once on your system. If you have already performed the prerequisite steps as part of an earlier MongoDB installation using Homebrew, you can skip to the installation procedure.
Install Xcode Command-Line Tools¶
Homebrew requires the Xcode command-line tools from Apple’s Xcode.
Install the Xcode command-line tools by running the following command in your macOS Terminal:
Install Homebrew¶
macOS does not include the Homebrew brew package by default.
Installing MongoDB 5.0 Community Edition¶
Follow these steps to install MongoDB Community Edition using Homebrew’s brew package manager. Be sure that you have followed the installation prerequisites above before proceeding.
Tap the MongoDB Homebrew Tap to download the official Homebrew formula for MongoDB and the Database Tools, by running the following command in your macOS Terminal:
If you have already done this for a previous installation of MongoDB, you can skip this step.
To install MongoDB, run the following command in your macOS Terminal application:
Alternatively, you can specify a previous version of MongoDB if desired. You can also maintain multiple versions of MongoDB side by side in this manner.
If you have previously installed an older version of the formula, you may encounter a ChecksumMismatchError. To resolve, see Troubleshooting ChecksumMismatchError.
The installation includes the following binaries:
- The mongod server
- The mongos sharded cluster query router
- The MongoDB Shell, mongosh
In addition, the installation creates the following files and directories at the location specified below, depending on your Apple hardware:
See Apple’s documentation for the current list of Apple hardware using the M1 processor. You can also run the following command to check where brew has installed these files and directories:
Starting with MongoDB 4.4.1, the installation also includes the MongoDB Database Tools. See Using the MongoDB Database Tools for more information.
Run MongoDB Community Edition¶
Follow these steps to run MongoDB Community Edition. These instructions assume that you are using the default settings.
You can run MongoDB as a macOS service using brew , or you can run MongoDB manually as a background process. It is recommended to run MongoDB as a macOS service, as doing so sets the correct system ulimit values automatically (see ulimit settings for more information).
To run MongoDB (i.e. the mongod process) as a macOS service, run:
To stop a mongod running as a macOS service, use the following command as needed:
To run MongoDB (i.e. the mongod process) manually as a background process, run:
For macOS running Intel processors:
To stop a mongod running as a background process, connect to the mongod using mongosh, and issue the shutdown command as needed.
Both methods use the mongod.conf file created during the install. You can add your own MongoDB configuration options to this file as well.
macOS may prevent mongod from running after installation. If you receive a security error when starting mongod indicating that the developer could not be identified or verified, do the following to grant mongod access to run:
- Open System Preferences
- Select the Security and Privacy pane.
- Under the General tab, click the button to the right of the message about mongod , labelled either Open Anyway or Allow Anyway depending on your version of macOS.
To verify that MongoDB is running, perform one of the following:
If you started MongoDB as a macOS service:
You should see the service mongodb-community listed as started .
If you started MongoDB manually as a background process:
You should see your mongod process in the output.
You can also view the log file to see the current status of your mongod process: /usr/local/var/log/mongodb/mongo.log .
Connect and Use MongoDB¶
To begin using MongoDB, connect mongosh to the running instance. From a new terminal, issue the following:
macOS may prevent mongosh from running after installation. If you receive a security error when starting mongosh indicating that the developer could not be identified or verified, do the following to grant mongosh access to run:
- Open System Preferences
- Select the Security and Privacy pane.
- Under the General tab, click the button to the right of the message about mongosh , labelled either Open Anyway or Allow Anyway depending on your version of macOS.
For information on CRUD (Create,Read,Update,Delete) operations, see:
Using the MongoDB Database Tools¶
Starting in MongoDB 4.4.1, installing MongoDB via brew also installs the MongoDB Database Tools.
The MongoDB Database Tools are a collection of command-line utilities for working with a MongoDB deployment, including data backup and import/export tools like mongoimport and mongodump as well as monitoring tools like mongotop .
Once you have installed the MongoDB Server in the steps above, the Database Tools are available directly from the command line in your macOS Terminal application. For example you could run mongotop against your running MongoDB instance by invoking it in your macOS Terminal like so:
It should start up, connect to your running mongod , and start reporting usage statistics.
See the MongoDB Database Tools Documentation for usage information for each of the Database Tools.
Additional Information¶
Localhost Binding by Default¶
By default, MongoDB launches with bindIp set to 127.0.0.1 , which binds to the localhost network interface. This means that the mongod can only accept connections from clients that are running on the same machine. Remote clients will not be able to connect to the mongod , and the mongod will not be able to initialize a replica set unless this value is set to a valid network interface.
This value can be configured either:
- in the MongoDB configuration file with bindIp , or
- via the command-line argument —bind_ip
Before binding to a non-localhost (e.g. publicly accessible) IP address, ensure you have secured your cluster from unauthorized access. For a complete list of security recommendations, see Security Checklist. At minimum, consider enabling authentication and hardening network infrastructure.
For more information on configuring bindIp , see IP Binding.
Troubleshooting ChecksumMismatchError¶
If you have previously installed an older version of the formula, you may encounter a ChecksumMismatchError resembling the following:
- Remove the downloaded .tgz archive.
Источник
Release Notes¶
MongoDB Compass 1.28.4В¶
Released August 30, 2021
- Enables resizing the preview area for aggregation pipelines.
- Allows hiding the Query History and Export to Language buttons in the query view.
- Bumps mongosh version for the embedded shell to 1.0.4 .
- Properly supports all Kerberos options.
- Fixed an issue with geospatial queries being incorrectly merged.
MongoDB Compass 1.28.1В¶
Released July 13, 2021
- Adds support for load balancer connections.
- Adds a Granularity option when creating a time series collection.
- Disallows editing schema validation for time series collections.
- Hides the Drop Collection button in readonly Compass.
- Geoqueries no longer populate query bar fields with null .
MongoDB Compass 1.26.1В¶
Released April 9, 2021
- Allows functions in the query bar and aggregations.
- When navigating to the Databases view, Compass now clears a previously selected collection from the left navigation.
- Updates the embedded MongoDB Shell to version 0.9.0 .
- Compass now displays the expected value when you update fields in the table view.
- Creating a collection or database is now prohibited when form fields are empty.
- Schema tab graphs no longer fail to render when switching tabs.
- SSH tunnel no longer hangs on disconnect.
MongoDB Compass 1.26.0В¶
Released March 3, 2021
- Adds ability to create text indexes.
- Adds ability to cancel a connection attempt.
- Data is now refreshed when Find is clicked in the query bar.
- Improvements to schema analysis to prevent timeouts with large datasets.
- Improves connection form input and validation.
- MongoDB Compass prevents inserting data via the JSON editor without specifying a document. Previously, Compass would silently error when a document was not specified.
- Saving a favorite connection no longer freezes MongoDB Compass.
- Stylistic fixes.
MongoDB Compass 1.25.0В¶
Released January 13, 2021
- Updates the embedded MongoDB Shell to version 0.6.1 .
- Improvements to connection validation.
- Compass no longer crashes during startup on certain versions of Windows. For more information see COMPASS-4510.
- When connecting to a MongoDB deployment, Compass no longer automatically inserts a value of 27017 for Port when Port is left blank.
- Compass no longer displays the incorrect port number when connecting to MongoDB via SRV record.
MongoDB Compass 1.24.1В¶
Released December 9, 2020
- Adds support for updates on sharded collections.
- Adds support for the print() method in the embedded MongoDB Shell.
- Updates the embedded MongoDB Shell to version 0.5.2 .
- Provides better readonly and view handling.
- Adds support for multi-line string editing in the field-by-field editor.
- Provides a descriptive tooltip when selecting an aggregation stage in the Aggregation Pipeline Builder.
- Non-editable fields can now be deleted in the field-by-field editor.
- Fixes connection URI issues with SCRAM-SHA-256.
- Adds support for $out when connected to a Data Lake.
- Removes broken import and export sidebar actions.
- Improves x.509 authentication. Makes the x.509 username optional in connection validation and improves validation error messages.
- Various other bug fixes and improvements.
MongoDB Compass 1.23В¶
Released November 4, 2020
- Notarizes MongoDB Compass for macOS Catalina. You should no longer need to manually allow macOS to trust MongoDB Compass before running.
- Kerberos authentication improvements on RHEL7.
- Importing a text pipeline containing a $out stage no longer crashes MongoDB Compass .
- Various other bug fixes and improvements.
MongoDB Compass 1.22В¶
Released September 3, 2020
- Added an embedded MongoDB Shell. You can use MongoDB Shell to test queries and operations in an interactive JavaScript interface.
MongoDB Compass 1.21В¶
Released April 28, 2020
- Improved CSV parsing when importing data.
- Added support for importing a subset of fields from CSV.
MongoDB Compass 1.20В¶
On macOS systems, the first time that you update MongoDB Compass to version 1.20 or later, you will need to allow access to your system storage for each saved connection in Recents and Favorites . To learn more, see Allow Keychain Access for Recent and Favorite Connections.
Released December 5, 2019
- Added the option to include driver syntax when exporting queries to a language.
- New and improved Connection experience with support for all connection options.
- Improved user experience for saving and sharing Favorite Connections.
- Added JSON mode for managing documents. With JSON mode, you can now insert multiple documents at once.
- Added support for querying UUIDs via the Documents query bar or in the Aggregation Pipeline Builder.
Added support for the following aggregation pipeline operators:
- $set
- $unset
- $replaceWith
MongoDB Compass 1.19В¶
Released August 11, 2019
Added support for:
- Views. You can create views based on results from an aggregation pipeline.
- Wildcard Indexes.
- Killing long-running operations from the Performance Tab.
- Adjusting the maximum timeout for queries executed in the Query Bar.
MongoDB Compass 1.18В¶
Released May 17, 2019
Provided fixes to the Compass Windows installer. With the new .msi installer you can:
- Select the destination of the Compass installation.
- Install Compass for all users.
- Script the Compass installation and perform a quiet install.
- Added support for JSON schema validation.
- Includes smart editor with autocomplete.
MongoDB Compass 1.17В¶
Released March 4, 2019
- Performance improvements to the Documents and Aggregation tabs, specifically with deeply nested documents.
Fixed several connection issues.
- Fixed Kerberos connections where hostname is not the canonical name.
- Fixed SRV connections with special characters in the password.
- Compass no longer allows direct connections to secondary databases, which would result in hangs on the loading navigation screen.
- Fixed connections to M0 Atlas clusters with readonly users.
MongoDB Compass 1.16В¶
Released November 12, 2018
Added collation support to the following features:
- Create a Collection
- Create a Database
- Create an Index
- Query Your Data
- Aggregation Pipeline Builder
MongoDB Compass 1.15В¶
Released August 23, 2018
Added support for exporting aggregation pipelines and exporting queries in the syntax of the following languages:
MongoDB Compass 1.14В¶
Released June 26, 2018
- Added Aggregation Pipeline Builder, which provides the ability to execute aggregation pipelines to gain additional insight into your data.
- Added MongoDB Compass Isolated Edition for highly secure environments. This edition does not initiate any network requests except to the MongoDB server.
MongoDB Compass 1.13В¶
Released May 3, 2018
- Added ability to import and export data in JSON and CSV format.
MongoDB Compass 1.12В¶
Released March 5, 2018
Added MongoDB Compass Readonly Edition which limits certain CRUD operations within your organization.
The following actions are not permitted in Compass Readonly Edition:
- Create and drop databases
- Create and drop collections
- Create, delete, edit and clone documents
- Create and drop indexes
- Create, delete and edit document validation rules
All other functionality remains the same as in standard MongoDB Compass .
MongoDB Compass 1.11В¶
Released December 17, 2017
- Added support for plugins that extend the functionality of MongoDB Compass .
- Added support for disconnecting from the active MongoDB instance without restarting MongoDB Compass .
- Added Table View for documents as a method of viewing the contents of a collection in tabular format.
MongoDB Compass 1.10В¶
Released Oct 25, 2017
Now available in two editions, Compass Community and Compass.
Compass provides the following features not in the Community edition:
MongoDB Compass 1.9В¶
Released Oct, 2017
- Added autocomplete functionality to the query bar.
- Query History Compass automatically stores up to 20 most recent queries for each collection. From the past queries view for a collection, you can view the recent queries as well as the queries saved as favorites . For more information, see View Past Queries.
- Deployment Awareness
When a user connects to a MongoDB instance, Compass now displays:
- The connection name if the connection is a favorite connection or «My Cluster» if it is not.
- The type of deployment (standalone, replica set, sharded cluster). If the deployment is a replica set and the replica set name is specified in the connection window, the number of replica set members will also be displayed.
For more information, see Compass Home.
MongoDB Compass 1.8В¶
Released Aug 2, 2017
- Documents tab is the default
- Schema sampling only on demand
- Explain executed only on demand
- Improved Document Editing
Deployment Awareness (and read preference)
- Added ability to specify replica set name and read preference in connection screen.
- Added ability to parse MongoDB URI string in the connection screen.
MongoDB Compass 1.7В¶
Released Jun 7, 2017
- Added ability to include options in the query bar.
- Added ability to add or delete database/collection from the left-hand navigation sidebar.
- Added ability to collapse the left-hand navigation sidebar.
MongoDB Compass 1.6В¶
Released Mar 1, 2017
- Added support for Linux: Ubuntu 14.04+ and RHEL 7+.
- Added ability to zoom in and zoom out of panels.
MongoDB Compass 1.5В¶
Released Nov 29, 2016
- Added ability to create and drop databases.
- Added ability to create and drop collections.
- Added ability to create indexes.
- Added support for document validation.
- Improved security when connecting to Atlas. During Connection setup, MongoDB Compass supports the use of System Certificate Authority for TLS/SSL connections to Atlas Deployment.
- Provides Real Time Performance stats.
MongoDB Compass 1.4В¶
Released Nov 1, 2016
- Add support for connecting to Atlas.
- Various bug fixes and improvements.
MongoDB Compass 1.3В¶
Released Sep 15, 2016
1.3.0-beta.3 — July 12, 2016В¶
- Allow specifying the value of the _id field when inserting new documents.
- Set the default field and value sizes to 1 when adding a new key to a document.
- Typing » : » in the key input field tabs to the value input field when editing a document.
- Only allow addition of one element at a time if the field name in the new element is blank when editing a document.
- CRUD documentation now available in the application help menu.
- Fix element autofocus on add.
1.3.0-beta.2 — June 29, 2016В¶
- Bug: Small Bug Fixes identified at MongoDB World
1.3.0-beta.0 — June 27, 2016В¶
- New: CRUD single document create, update, delete
- New: SSH tunnel support
- New: Tree explain plan view
- New: Geographic query builder and visualization
- Explicit opt-in for «3rd party maps» usage
- Improve display of binary data in in the document viewer
- Query builder on numeric histograms should leave bounds open
- Intercom overlay button now visible
- Load preferences defensively, catching parsing errors and reset preferences
- Compass Treasure Hunt for MongoDB World
MongoDB Compass 1.2В¶
Released Jun 27, 2016
- Beta installs alongside the stable release as a distinct application, with distinct preferences
- Index view
- Explain plan view
- Documents view moved to a separate tab
- Automatic updates
1.2.0-beta.3 — June 23, 2016В¶
- Bug: Feature Tour does not show on first launch
- Bug: Compass fails to start with JavaScript error in main process: SyntaxError: Unexpected end of input
- Bug: No error displayed message when an authentication error occurs
- Bug: Compass does not handle $indexStats fetch failure on MongoDB 3.2
1.2.0-beta.2 — June 1, 2016В¶
- NEW: Added explain plan view
- Added feature tour points of new 1.2 features
- Bugfix: After increasing maxTimeMS timeout, query default falls back to 100 docs
1.2.0-beta.1 — May 10, 2016В¶
MongoDB Compass 1.1В¶
Released Jan 19, 2016
1.1.1 — Jan 19, 2016В¶
MongoDB Compass 1.0В¶
Released Dec 7, 2015
MongoDB Compass 1.0 is now available. It helps users to visually analyze and understand their MongoDB data.
Источник