I'm using mongoDB, mongoose and express, and I want to use the "find" method like this:
checklist.find( { _id: { $in: checklistIdsArray } } )
Basically I want to find all checklists that are listed in the checklistIdsArray. Now this works fine, but I used a POST request instead of a GET request, because I needed to send the "checklistIdsArray" object to the server and I cannot do it in a GET request, as the GET request doesn't have a body, well technically it can have but it is not recommended.
function getTripChecklists(checklistsIds) {
var URL = SERVER_URL + '/checklists/tripchecklists';
return $http.post(URL, checklistsIds)
.then(successHandler)
.catch(errorHandler);
}
Is this the best approach to accomplish what I want, or is there a better way ?