website logo
⌘K
πŸ–οΈIntroduction to hyper cloud
🍎Getting Started
😍What's New
Blueberry Migration Guide
πŸ’ͺWorkshops
Deno Workshops
NodeJS Workshops
⚑Quickstarts
NodeJS Quickstarts
πŸ”ŒAPI Reference (hyper cloud)
🍎Basics
⚑hyper connect
πŸ”‘JWT Auth
πŸ’ΎData API
🏎️Cache API
πŸ”ŽSearch API
πŸ—„οΈStorage API
πŸ€“Queue API
πŸ”“Sign In
⚑Applications
βš™οΈSettings
πŸ”‘App Keys
πŸ‘₯Teams
Switching Between Accounts
Application Services
Application Service Instances
Adding a Queue Service
Adding a Search Service
Subscriptions
πŸ€‘Upgrade
πŸ“•Terminology
Parameters
πŸ’³Billing
Payment and Pricing Terms
πŸ’ΌLegal
Terms of Service
Acceptable Use Policy
Privacy Policy
πŸ•ΆοΈHyper Vision
Docs powered byΒ archbeeΒ 
15min

Create a Document

POST /{appname}/data/{servicename}

Having a datastore is great! Now you are ready to start adding documents to your store. The create document command will add a JSON document to your datastore.

Recommendations

  • Create your own unique _id in your JSON document
  • Use a field on each document to distinguish its type from other documents ie. type docType , etc.

Parameters

Path

  • appname - string - the name of your hyper cloud application.
  • servicename - string - the name of your hyper cloud service.

Request Body

After the Blueberry release on 1/17/2022, the id field will no longer be generated on your documents by the data service. Instead, the _id field will be generated, if your document does not already contain an _id. more...ο»Ώ

A JSON document with one to many fields. An _id field is allowed. If an _id is not provided, it will be generated on the document. Each field name must follow the following rules:

  • must begin with a lowercase letter (a-z), unless it is the _id field.
  • must be lowercase letters (a-z)
  • digits (0-9)
  • any of these characters _ $ + -

Request Payload Limit

When creating or updating a document within the Data service, the request body payload size limit for the Data service is 5MB.

JSON
|

Examples

Create a document in the datastore

Don't forget!

Be sure to set your HYPER environment variable with the value of your hyper app's connection string.

Node.js
Curl
|

Responses

When making a request to this endpoint you can get the following responses returned:

Status Code

Description

Response

201

Successfully created document

{"ok": true, "id": "1234"}

500

An error occurred trying to create a document

{"ok": false, "msg": "..."}

Need Help?

You can always reach out to our support team for any additional assistance on slack.

Updated 24 Mar 2022
Did this page help you?
Yes
No
UP NEXT
Retrieve a Document By Id
Docs powered byΒ archbeeΒ 
TABLE OF CONTENTS
POST /{appname}/data/{servicename}
Recommendations
Parameters
Path
Request Body
Request Payload Limit
Examples
Don't forget!
Responses
Need Help?