Skip to content
michael-lefebvre edited this page Apr 7, 2013 · 4 revisions

API - Document

<doc-ref> is the _ref field in MongoDB.

List

    GET - /api/<app-slug>/document/<collection-namespace>

return:

	{
		"total": 9,
		"skip": 0,
		"limit": 999999,
		"results": [
			{
				"_ref": "4fd44bfdd3f3f",
				"name": "The Road Runner",
				"name-given": "Accelleratii incredibus",
				"voiced": [
					"Paul Julian",
					"Mel Blanc",
					"Dee Bradley Baker",
					"Frank Welker"
				]
			},
			{
				"_ref": "5r4cd77bfdd2e2e",
				"name": "Wile E. Coyote",
				"name-given": "Eatibus anythingus",
				"voiced": [
					"Silent",
					"Mel Blanc",
					"Joe Alaskey",
					"Dee Bradley Baker",
					"Maurice LaMarche"
				]
			}
		]
	}

Arguments

  • r int the revision number
  • l string the locale code, ex: fr_FR
  • q json MongoDb query

MongoDb query is a JSON formated string, ex:

	?q={"select": ["title"], "where":{"title":"hello"}}

Allowed parameters are:

  • select array
  • where object
  • sort object
  • limit integer
  • skip integer

Single document

    CRUD - /api/<app-slug>/document/<collection-namespace>/<doc-ref>

return:

	{
		"_ref": "5r4cd77bfdd2e2e",
		"name": "Wile E. Coyote",
		"name-given": "Eatibus anythingus",
		"voiced": [
			"Silent",
			"Mel Blanc",
			"Joe Alaskey",
			"Dee Bradley Baker",
			"Maurice LaMarche"
		]
	}

You can get a specific revision with the r argument

    GET  - /api/<app-namespace>/document/<collection-slug>/<doc-ref>?r=int

Clone this wiki locally