Skip to content
This repository was archived by the owner on Dec 10, 2018. It is now read-only.

Querying

jkeroes edited this page Dec 3, 2011 · 3 revisions

h3. Usage

bc. http://localhost:27080/dbname/cname/_find

h3. Description

Query for documents. See also Getting More Results.

h3. Request Type

GET

h3. Optional Arguments

  • @criteria=search_criteria@ (object)
  • @fields=fields_to_return@ (object)
  • @sort=sort_fields@ (object)
  • @skip=num@ (number)
  • @limit=num@ (number)
  • @explain=true@
  • @batch_size=num_to_return@ (number)

h3. Return Values

bc. {"ok" : 1, "results" : [{...}, ... ], "id" : cursor_id}

h3. Example: Basic Find

Find all documents in the foo.bar namespace.

bc. $ curl -X GET 'http://localhost:27080/foo/bar/_find'

h3. Example: Find with Sort

Find all documents in the foo.bar namespace and sort by x descending

bc. $ curl -X GET 'http://localhost:27080/foo/bar/_find?sort=%7B%22x%22%3A-1%7D'

Decoded, we're really requesting http://localhost:27080/foo/bar/_find?sort={"x":-1}

Clone this wiki locally