The function ESConnector.prototype.buildFilter = function (modelName, idName, criteria, size, offset) expects parameter criteria to be a String as given in its description:
/**
* Make filter from criteria, data index and type
* Ex:
* {"body": {"query": {"match": {"title": "Futuro"}}}}
* {"q" : "Futuro"}
* @param {String} modelName filter
* @param {String} criteria filter
* @param {number} size of rows to return, if null then skip
* @param {number} offset to return, if null then skip
* @returns {object} filter
*/
Whereas, it is explicitly used as an object inside the function.
How to recreate issue?
Use any good IDE like Webstorm, and you'll get an error while using the function that says something like this:
Argument filter should be of type String
I know this is a very petty issue, but can confuse people. So I am gonna go ahead and create a pull request for the same, unless, it being String serves some purpose that I do not see.
Description
The function
ESConnector.prototype.buildFilter = function (modelName, idName, criteria, size, offset)
expects parametercriteria
to be aString
as given in its description:Whereas, it is explicitly used as an object inside the function.
How to recreate issue?
Use any good IDE like Webstorm, and you'll get an error while using the function that says something like this:
Argument filter should be of type String
I know this is a very petty issue, but can confuse people. So I am gonna go ahead and create a pull request for the same, unless, it being
String
serves some purpose that I do not see.