services

Generate a JSON schema from sample

Sample a subset of documents in a collection to generate a JSON schema.

post/groups/{groupId}/apps/{appId}/services/{serviceId}/commands/generate_schema

Request

  • Base URL
    https://services.cloud.mongodb.com/api/admin/v3.0
  • URL
    https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/services/{serviceId}/commands/generate_schema
  • Auth
    HTTP bearer

Request body

database_namestring required

The name of the database that contains the collection.

collection_namestring required

The name of the collection to sample and generate a schema for.

limitinteger required

The maximum number of documents to include in the sample.

Response

Successfully generated schema

schemaobject

The generated JSON schema

Changes

No recorded changes to this operation across all 50 revisions of this API.