Skip to main content
Version: v2.x

MongoDB

Introduction​

Supported versions:

Hasura GraphQL Engine v2.27.0 onwards

Supported features

Hasura currently supports queries, table relationships, remote relationships and permissions on MongoDB databases.

A logical model or database validation schema is required for generating your GraphQL schema.

Get Started​

To try Hasura with MongoDB, you'll need a new or existing MongoDB instance (either self-hosted, or available through MongoDB Atlas).

To get started with MongoDB:

Feature Support​

FeatureMongoDB
Remote Relationships✅
Views✅
Custom Functions❌
Logical Models✅
Native Queries❌

Queries​

FeatureMongoDB
Simple✅
Nested Object✅
Aggregation✅
Filter / Search✅
Sort✅
Distinct✅
Paginate✅
Multiple Arguments✅
Multiple Queries✅
Variables / Aliases / Fragments✅
Filtering

Currently, only documents from a relation can be filtered.

Mutations​

FeatureMongoDB
Insert❌
Upsert❌
Update❌
Delete❌
Multiple per Request❌

Subscriptions​

FeatureMongoDB
Value of Field❌
Updates to Rows❌
Value of Derived Field❌
Streaming Subscriptions❌

Event Triggers​

FeatureMongoDB
INSERT❌
UPDATE❌
DELETE❌
MANUAL❌

Managing data with the Hasura Console​

The Hasura Console is a web UI that allows you to manage your data and metadata. It is available at http://localhost:8080/console when you run Hasura locally, or from your project's Console endpoint when you use Hasura Cloud.

The data-management features (such as creating tables) are available in the Data tab. You can access your GraphQL API in the API tab and interact with it using the GraphiQL interface.

Console support

We recommend using your preferred MongoDB client instead. The Hasura Console is designed to be a tool for managing your GraphQL API, and not a full-fledged database management tool.

Keep up to date​

If you'd like to stay informed about the status of MongoDB support, subscribe to our newsletter and join our Discord!

Know more​