{"action":"created","issue":{"url":"https://api.github.com/repos/marklogic/node-client-api/issues/139","labels_url":"https://api.github.com/repos/marklogic/node-client-api/issues/139/labels{/name}","comments_url":"https://api.github.com/repos/marklogic/node-client-api/issues/139/comments","events_url":"https://api.github.com/repos/marklogic/node-client-api/issues/139/events","html_url":"https://github.com/marklogic/node-client-api/issues/139","id":58962083,"number":139,"title":"Question: Can I pass structured JSON to the a queryBuilder?","user":{"login":"clockworked247","id":1016149,"avatar_url":"https://avatars.githubusercontent.com/u/1016149?v=3","gravatar_id":"","url":"https://api.github.com/users/clockworked247","html_url":"https://github.com/clockworked247","followers_url":"https://api.github.com/users/clockworked247/followers","following_url":"https://api.github.com/users/clockworked247/following{/other_user}","gists_url":"https://api.github.com/users/clockworked247/gists{/gist_id}","starred_url":"https://api.github.com/users/clockworked247/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clockworked247/subscriptions","organizations_url":"https://api.github.com/users/clockworked247/orgs","repos_url":"https://api.github.com/users/clockworked247/repos","events_url":"https://api.github.com/users/clockworked247/events{/privacy}","received_events_url":"https://api.github.com/users/clockworked247/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-25T20:13:19Z","updated_at":"2015-02-25T20:27:25Z","closed_at":"2015-02-25T20:27:25Z","body":"If I have the following JSON:\r\n\r\nquery: { and-query: { queries: [{range-constraint-query: {constraint-name: \"tag\", value: \"testing\"}}]} }\r\n\r\nIs there a simple way to pass that to queryBuilder and it would \"just work\"?  QueryByExample seems closest to that, but not quite.  \r\n\r\nThe alternative seems to be that I would need to traverse the object and generate the queryBuilder specifics depending on what sort of queries and/or queries I come across.\r\n\r\nThanks.\r\n"},"comment":{"url":"https://api.github.com/repos/marklogic/node-client-api/issues/comments/76048896","html_url":"https://github.com/marklogic/node-client-api/issues/139#issuecomment-76048896","issue_url":"https://api.github.com/repos/marklogic/node-client-api/issues/139","id":76048896,"user":{"login":"ehennum","id":1170070,"avatar_url":"https://avatars.githubusercontent.com/u/1170070?v=3","gravatar_id":"","url":"https://api.github.com/users/ehennum","html_url":"https://github.com/ehennum","followers_url":"https://api.github.com/users/ehennum/followers","following_url":"https://api.github.com/users/ehennum/following{/other_user}","gists_url":"https://api.github.com/users/ehennum/gists{/gist_id}","starred_url":"https://api.github.com/users/ehennum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehennum/subscriptions","organizations_url":"https://api.github.com/users/ehennum/orgs","repos_url":"https://api.github.com/users/ehennum/repos","events_url":"https://api.github.com/users/ehennum/events{/privacy}","received_events_url":"https://api.github.com/users/ehennum/received_events","type":"User","site_admin":false},"created_at":"2015-02-25T20:27:25Z","updated_at":"2015-02-25T20:27:25Z","body":"You can't pass a JSON query to the query builder.  The expected model of use is to build up the query in code.\r\n\r\nYou can pass a JSON combined query definition to the db.documents.query() function.  Please see:\r\n\r\nhttp://docs.marklogic.com/jsdoc/documents.html#query\r\nhttp://docs.marklogic.com/jsdoc/documents.html#CombinedQueryDefinition\r\n"}}