This is an experimental definition in Paw of the REST API for the new Document Data Model (DocDM) in Caché. For more information on DocDM see the Useful Links below.
There are three environments defined in the Paw file which you can change, or copy and modify, to suit your requirements. The default values included in the file are shown in parentheses for each Paw environment variable.
- Protocol (http)
- Server (localhost)
- Port (57772)
- name (user)
- name (states)
- sampleDoc (example JSON object containing definition of all states)
The API examples included in the Paw file are listed below. In all cases the default values from the Server environment above are used in this README.
- All collections for a database
- All documents for a collection
- Get a document from a collection
- Get last inserted document from a collection
- Filtered documents for a collection
- Populate a collection from Array
- Delete a collection from the database
- Insert new document in a collection
- Update a document in a collection
- Update last inserted document in a collection
- Delete a document from a collection Duplicate
- Delete last inserted document from a collection
GET http://localhost:57772/api/document/v1/{Database name}
GET http://localhost:57772/api/document/v1/{Database name}/{Collection name}
GET /api/document/v1/{Database name}/{Collection name}/{Document Id}
You can use the Document-Id header in the request as an easy way to enter the Document Id for your request (this is part of my Paw implementation, not the DocDM API).
This is the same as Get a document from a collection except that the Document Id is automatically populated from the last document inserted.
POST http://localhost:57772/api/document/v1/{Database name}/{Collection name}?action=query
Returns all Documents from a Collection in a Database that match the Query specified in the body of the request.
POST http://localhost:57772/api/document/v1/{Database name}/{Collection name}?action=insertArray
Populate a Collection by inserting one Document for each object in the array in the request body.
DELETE http://localhost:57772/api/document/v1/{Database name}/{Collection name}
POST http://localhost:57772/api/document/v1/{Database name}/{Collection name}
Insert a single Document into a Collection in a Database. The document to be inserted is defined as a JSON object in the request body.
PUT http://localhost:57772/api/document/v1/{Database name}/{Collection name}/{Document Id}
Update an existing Document within a Collection in a Database. The updated document defined as a JSON object in the request body. You can use the Document-Id header in the request as an easy way to enter the Document Id for your request (this is part of my Paw implementation, not the DocDM API).
This is the same as Update a document in a collection except that the Document Id is automatically populated from the last document inserted.
DELETE http://localhost:57772/api/document/v1/{Database name}/{Collection name}/{Document Id}
Delete an existing Document from a Collection in a Database. You can use the Document-Id header in the request as an easy way to enter the Document Id for your request (this is part of my Paw implementation, not the DocDM API).
This is the same as Delete a document from a collection except that the Document Id is automatically populated from the last document inserted.