partialSearch Issue
wjozefssrf opened this issue · 1 comments
wjozefssrf commented
i wana get only the ip address of node " server 1 "
im sending a request like this
Code :
chef.partialSearch("node", "name:server1",{"ip":"ipaddress"} ,function(err, res){
if (err){console.log(error);}
else{console.log(res);}
});
Or
chef.partialSearch("node", { q: "name:server1"} ,{"ip":"ipaddress"} ,function(err, res){
....
});
=> Response :
received status code 400 invalid value 'ipaddress' for no_key
function in code source : partialSearch: function(index, qs, data, fn) { ... }
Can you please give a valid syntax with example .
Thanks
wjozefssrf commented
Correct Syntax For Search Methods
Simple Search : Exemple
chef.search("node", {q: "name:server1" }, function(err, res){ if (err){console.log(error);} else{console.log(res);} });
Partial Search : Exemple
chef.partialSearch("node", {q: "role:web"}, { name: ['name'] , 'ipaddress': ['ipaddress'] }, function(err, res){ if (err){console.log(error);} else{console.log(res);} });