MongoEngine / MongoEngine/mongoengine

Exporting Document as JSON schema

Open
#2,609 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
4.3k
Forks
1.2k
Avg merge
4h 41m
Merged PRs (30d)
11

Description

Hi,

Is it possible to export a MongoEngine Document as a mongo-friendly JSON schema? It might be quite helpful for writing migrations and ensuring that the collection has exactly the data it should have without a bunch of corner cases.

The workflow is approximately like: write the model -> get the schema -> plug it into mongo with Warning level -> adjust -> deploy -> switch to Strict level -> repeat

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with MongoEngine Document models and the MongoDB $jsonSchema reference linked in the issue. Define the supported export behavior and verify that generated schemas can be used in the described Warning-to-Strict validation workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb, python
Domain
backend, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.