Skip to content
This repository has been archived by the owner on Jul 28, 2021. It is now read-only.

Sending Requests: Drop Database & Collection Requests.

Mihou edited this page Jun 22, 2021 · 1 revision

🥏 Drop Requests

There are two ways for DROP requests, one is for dropping collections and the other for dropping database.

  • To drop a database, you can leave out collection from the request.
  • To drop a collection, you have to have both collection and database on the request.

The method field for this request must be drop.

Collection Drop Request

You can use the Queria format:

database.collection.drop()

Or if you like, feel free to use the JSON format which has fields as written below:

FIELD TYPE DESCRIPTION
method string The type of request to send.
database string The database where the collection is located.
collection string The collection to drop.
unique string The unique value to return (used for getting back exact responses from the server).

Collection Drop Response

FIELD TYPE DESCRIPTION
response string Replies back with something among the likes of: "Successfully deleted the collection {{collection}}"
kode integer The server reply code (1 for success, 0 for no results, -1 for invalid request).
replyTo string The unique code sent back (for callbacks).

Collection Drop Example Response

{
    "response": "Successfully deleted the collection Mana",
    "kode": 1,
    "replyTo": "Unique Identifier from Request"
}

Database Drop Request

You can use the Queria format:

database.drop()

Or if you like, feel free to use the JSON format which has fields as written below:

FIELD TYPE DESCRIPTION
method string The type of request to send.
database string The database to drop.
unique string The unique value to return (used for getting back exact responses from the server).

Database Drop Response

FIELD TYPE DESCRIPTION
response string Replies back with something among the likes of: "Successfully deleted the database {{database}}"
kode integer The server reply code (1 for success, 0 for no results, -1 for invalid request).
replyTo string The unique code sent back (for callbacks).

Database Drop Response Example

{
    "response": "Successfully deleted the database rose_db",
    "kode": 1,
    "replyTo": "Unique Identifier from Request"
}