add_document

The function add_document(document, collection_name) uploads a single document to a collection.

Input

  • document (dictionary) – Represents the document to upload. The structure of each document must conform to the database schema configuration file. It must be of type dictionary.

  • collection_name (str) – Specifies the name of the Collection into which to load the document.

Example

new_document= {"id": "131",
               "name": "dave",
                "age": 43}
hyperspace_client.add_document(document, collection_name)

Response

The following response should be received –

{'status': 'OK', 'code': 200, 'message': 'Document was successfully added'}

Last updated