Skip to content
Mark Gorenstein edited this page Jun 6, 2014 · 5 revisions

To Connect and Authenticate

% curl -u USERNAME:PASSWORD --data 'username=USERNAME&password=PASSWORD' 'http://IP:PORT/_authenticate'

To Query

% curl -u USERNAME:PASSWORD -X GET 'IP:PORT/opensyllabus/opensyllabus/_find'

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)

Example:
To return three documents:
% curl -u USERNAME:PASSWORD -X GET 'IP:PORT/opensyllabus/opensyllabus/_find?batch_size=3'

Additional explanation and examples at sleepy mongoose docs, and a good tutorial here.

Clone this wiki locally