How to use 'mongoose or' in JavaScript

Every line of 'mongoose or' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
33function $or (value, esQuery, idProp) {
34 validateType(value, '$or', 'array');
35
36 esQuery.should = esQuery.should || [];
37 esQuery.should.push(...value
38 .map(subQuery => parseQuery(subQuery, idProp))
39 .filter(parsed => !!parsed)
40 .map(parsed => ({ bool: parsed }))
41 );
42 esQuery.minimum_should_match = 1;
43
44 return esQuery;
45}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

134or (index) {
135 assert(this._where, QueryError, 'Can not have a .or() before a .where()')
136 // TODO
137}

Related snippets