Skip to content

Document database endpoints

30 endpoints at https://api.vaif.studio, generated from the API's OpenAPI document. The REST API page covers authentication, and All endpoints lists every group.

GET /mongodb/collections

Response 200 (application/json)
{
  name: string;
  type?: string;
}[]

POST /mongodb/collections

Request body (application/json)
{
  name: string;
  options?: {
    capped?: boolean;
    size?: number;
    max?: number;
    validator?: { [key: string]: any };
    validationLevel?: "moderate" | "off" | "strict";
    validationAction?: "error" | "warn";
  };
}
Response 200 (application/json)
{
  ok: boolean;
  collection: string;
}

DELETE /mongodb/collections/{name}

ParameterInTypeRequired
namepathstringYes
Response 200 (application/json)
{
  ok: boolean;
}

POST /mongodb/collections/{name}/rename

ParameterInTypeRequired
namepathstringYes
Request body (application/json)
{
  newName: string;
}
Response 200 (application/json)
{
  ok: boolean;
  oldName: string;
  newName: string;
}

POST /mongodb/command

Response 200 (application/json)
{
  [key: string]: null | boolean | number | string | JsonValue[] | {
    [key: string]: JsonValue;
  };
}

POST /mongodb/{collection}/find

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  filter?: { [key: string]: any };
  options?: {
    projection?: { [key: string]: any };
    sort?: any[][] | { [key: string]: any };
    skip?: number;
    limit?: number;
    hint?: { [key: string]: any } | string;
  };
}
Response 200 (application/json)
{
  [key: string]: null | boolean | number | string | JsonValue[] | {
    [key: string]: JsonValue;
  };
}[]

POST /mongodb/{collection}/find/cursor

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  filter?: { [key: string]: any };
  options?: {
    projection?: { [key: string]: any };
    sort?: any[][] | { [key: string]: any };
    skip?: number;
    limit?: number;
    hint?: { [key: string]: any } | string;
  };
  batchSize?: number;
}
Response 200 (application/json)
{
  cursorId: string;
  batch: { [key: string]: any }[];
  exhausted: boolean;
}

POST /mongodb/{collection}/findOne

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  filter?: { [key: string]: any };
  options?: {
    projection?: { [key: string]: any };
    sort?: any[][] | { [key: string]: any };
    hint?: { [key: string]: any } | string;
  };
}
Response 200 (application/json)
{
  [key: string]: null | boolean | number | string | JsonValue[] | {
    [key: string]: JsonValue;
  };
} | null

GET /mongodb/{collection}/findById/{id}

ParameterInTypeRequired
collectionpathstringYes
idpathstringYes
Response 200 (application/json)
{
  [key: string]: null | boolean | number | string | JsonValue[] | {
    [key: string]: JsonValue;
  };
}

POST /mongodb/{collection}/count

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  filter?: { [key: string]: any };
}
Response 200 (application/json)
{
  count: number;
}

GET /mongodb/{collection}/estimatedCount

ParameterInTypeRequired
collectionpathstringYes
Response 200 (application/json)
{
  count: number;
}

POST /mongodb/{collection}/distinct

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  field: string;
  filter?: { [key: string]: any };
}
Response 200 (application/json)
(null | boolean | number | string | JsonValue[] | {
  [key: string]: JsonValue;
})[]

POST /mongodb/{collection}/insertOne

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  document: { [key: string]: any };
}
Response 200 (application/json)
{
  acknowledged: boolean;
  insertedId: string;
}

POST /mongodb/{collection}/insertMany

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  documents: { [key: string]: any }[];
  options?: {
    ordered?: boolean;
  };
}
Response 200 (application/json)
{
  acknowledged: boolean;
  insertedCount: number;
  insertedIds: string[];
}

POST /mongodb/{collection}/updateOne

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  filter: { [key: string]: any };
  update: { [key: string]: any };
  options?: {
    upsert?: boolean;
    arrayFilters?: { [key: string]: any }[];
    hint?: { [key: string]: any } | string;
  };
}
Response 200 (application/json)
{
  acknowledged: boolean;
  matchedCount: number;
  modifiedCount: number;
  upsertedId?: string;
  upsertedCount: number;
}

POST /mongodb/{collection}/updateMany

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  filter: { [key: string]: any };
  update: { [key: string]: any };
  options?: {
    upsert?: boolean;
    arrayFilters?: { [key: string]: any }[];
    hint?: { [key: string]: any } | string;
  };
}
Response 200 (application/json)
{
  acknowledged: boolean;
  matchedCount: number;
  modifiedCount: number;
  upsertedId?: string;
  upsertedCount: number;
}

POST /mongodb/{collection}/replaceOne

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  filter: { [key: string]: any };
  replacement: { [key: string]: any };
  options?: {
    upsert?: boolean;
    hint?: { [key: string]: any } | string;
  };
}
Response 200 (application/json)
{
  acknowledged: boolean;
  matchedCount: number;
  modifiedCount: number;
  upsertedId?: string;
  upsertedCount: number;
}

POST /mongodb/{collection}/findOneAndUpdate

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  filter: { [key: string]: any };
  update: { [key: string]: any };
  options?: {
    upsert?: boolean;
    returnDocument?: "after" | "before";
    projection?: { [key: string]: any };
    sort?: any[][] | { [key: string]: any };
    arrayFilters?: { [key: string]: any }[];
  };
}
Response 200 (application/json)
{
  value: null | {
    _id: {
      _bsontype: "ObjectId";
      id: {
        BYTES_PER_ELEMENT: number;
        buffer: any;
        byteLength: number;
        byteOffset: number;
        length: number;
      };
    };
  };
  ok: number;
}

POST /mongodb/{collection}/findOneAndReplace

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  filter: { [key: string]: any };
  replacement: { [key: string]: any };
  options?: {
    upsert?: boolean;
    returnDocument?: "after" | "before";
    projection?: { [key: string]: any };
    sort?: any[][] | { [key: string]: any };
  };
}
Response 200 (application/json)
{
  value: null | {
    _id: {
      _bsontype: "ObjectId";
      id: {
        BYTES_PER_ELEMENT: number;
        buffer: any;
        byteLength: number;
        byteOffset: number;
        length: number;
      };
    };
  };
  ok: number;
}

POST /mongodb/{collection}/deleteOne

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  filter: { [key: string]: any };
}
Response 200 (application/json)
{
  acknowledged: boolean;
  deletedCount: number;
}

POST /mongodb/{collection}/deleteMany

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  filter: { [key: string]: any };
}
Response 200 (application/json)
{
  acknowledged: boolean;
  deletedCount: number;
}

POST /mongodb/{collection}/findOneAndDelete

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  filter: { [key: string]: any };
  options?: {
    projection?: { [key: string]: any };
    sort?: any[][] | { [key: string]: any };
  };
}
Response 200 (application/json)
{
  value: null | {
    _id: {
      _bsontype: "ObjectId";
      id: {
        BYTES_PER_ELEMENT: number;
        buffer: any;
        byteLength: number;
        byteOffset: number;
        length: number;
      };
    };
  };
  ok: number;
}

POST /mongodb/{collection}/aggregate

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  pipeline: { [key: string]: any }[];
  options?: {
    allowDiskUse?: boolean;
    maxTimeMS?: number;
    hint?: { [key: string]: any } | string;
    comment?: string;
  };
}
Response 200 (application/json)
{
  [key: string]: null | boolean | number | string | JsonValue[] | {
    [key: string]: JsonValue;
  };
}[]

POST /mongodb/{collection}/aggregate/cursor

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  pipeline: { [key: string]: any }[];
  options?: {
    allowDiskUse?: boolean;
    maxTimeMS?: number;
    hint?: { [key: string]: any } | string;
    comment?: string;
  };
  batchSize?: number;
}
Response 200 (application/json)
{
  cursorId: string;
  batch: { [key: string]: any }[];
  exhausted: boolean;
}

GET /mongodb/{collection}/indexes

ParameterInTypeRequired
collectionpathstringYes
Response 200 (application/json)
{
  name: any;
  key: any;
  unique: any;
  sparse: any;
}[]

POST /mongodb/{collection}/indexes

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  keys: any[][] | { [key: string]: any } | string;
  options?: {
    unique?: boolean;
    sparse?: boolean;
    background?: boolean;
    name?: string;
    expireAfterSeconds?: number;
    partialFilterExpression?: { [key: string]: any };
  };
}
Response 200 (application/json)
{
  indexName: string;
}

DELETE /mongodb/{collection}/indexes/{indexName}

ParameterInTypeRequired
collectionpathstringYes
indexNamepathstringYes
Response 200 (application/json)
{
  ok: boolean;
}

POST /mongodb/{collection}/bulkWrite

ParameterInTypeRequired
collectionpathstringYes
Request body (application/json)
{
  operations: {
    insertOne?: {
      document: { [key: string]: any };
    };
    updateOne?: {
      filter: { [key: string]: any };
      update: { [key: string]: any };
      upsert?: any;
    };
    updateMany?: {
      filter: { [key: string]: any };
      update: { [key: string]: any };
      upsert?: any;
    };
    replaceOne?: {
      filter: { [key: string]: any };
      replacement: { [key: string]: any };
      upsert?: any;
    };
    deleteOne?: {
      filter: { [key: string]: any };
    };
    deleteMany?: {
      filter: { [key: string]: any };
    };
  }[];
  options?: {
    ordered?: boolean;
  };
}
Response 200 (application/json)
{
  insertedCount: number;
  matchedCount: number;
  modifiedCount: number;
  deletedCount: number;
  upsertedCount: number;
  upsertedIds: { [key: string]: any };
}

POST /mongodb/{collection}/cursor/{cursorId}/next

ParameterInTypeRequired
collectionpathstringYes
cursorIdpathstringYes
Response 200 (application/json)
{
  batch: { [key: string]: any }[];
  exhausted: boolean;
}

POST /mongodb/{collection}/cursor/{cursorId}/close

ParameterInTypeRequired
collectionpathstringYes
cursorIdpathstringYes
Response 200 (application/json)
{
  ok: boolean;
}