Docs Menu
Docs Home
/
MongoDB for IntelliJ Plugin

Autocomplete

On this page

  • Database Name Autocompletion
  • Collection Name Autocompletion
  • Document Field Name Autocompletion
  • Learn More

The MongoDB for IntelliJ Plugin provides autocomplete suggestions for database, collection, or field names based on the connected data source. For example, when you start typing a field name in a query, the plugin analyzes the MongoDB collection and document schema to automatically suggest valid field names.

To use the autocomplete feature, start typing in a document field, collection, or database name. Then press Ctrl + Space to display a drop-down list that shows the available suggestions.

To autocomplete database names, press Ctrl + Space inside the getDatabase() method of a MongoClient instance.

The IntelliJ Plugin displays a drop-down list of available database names, denoted by the MongoDB Database text and the database icon, as shown in the following image:

Autocomplete database names in the IntelliJ Plugin.

To autocomplete collection names, press Ctrl + Space inside the getCollection() method of a MongoClient instance.

The IntelliJ Plugin displays a drop-down list of available collection names, denoted by the MongoDB Collection text and the collection icon, as shown in the following image:

Autocomplete collections names in the IntelliJ Plugin.

Important

Collection name autocompletion currently requires a complete query to suggest collection names. For example, you must write a query that specifies the database name and a document field for the IntelliJ Plugin to suggest valid collection names.

To autocomplete document field names, press Ctrl + Space inside one of the following MongoCollection methods:

  • countDocuments

  • deleteMany

  • deleteOne

  • distinct

  • find

  • findOneAndDelete

  • findOneAndReplace

  • findOneAndUpdate

  • replaceOne

  • updateMany

  • updateOne

The IntelliJ Plugin displays a drop-down list of available field names, denoted by their data type and the document icon. For example, the following image shows autocomplete suggestions for fields that start with rat in the sample_mflix.movies collection:

Autocomplete document field names in the IntelliJ Plugin.
  • Connect to Your MongoDB Deployment

  • Database Reference Validation

  • Run Java Queries

Back

Connect