Projecting documents

Projection limits the fields to return for all matching documents, specifying the inclusion or the exclusion of fields.

This is done via the keys query parameter.

The system properties (properties starting with _ that are managed automatically by RESTHeart) are not affected by this option.


return just the property title

$ http GET{'title':1}

return all but the property title

$ http GET{'title':0}

return just the properties title and summary

$ http GET "{title:1}&keys={'summary':1}"

note that you specify multiple keys using multiple keys query parameters

Documentation references

How to use the examples

The examples make use of the brilliant httpie CLI HTTP client and are ment to be used with RESTHeart stareted on the localhost without the authentication enabled.

Eventually pass username and password with the -a username:password option.