* Convert $or queries into an array of where conditions
(where)
| 58 | * Convert $or queries into an array of where conditions |
| 59 | */ |
| 60 | function flattenOrQueries(where) { |
| 61 | if (!Object.prototype.hasOwnProperty.call(where, '$or')) { |
| 62 | return where; |
| 63 | } |
| 64 | var accum = []; |
| 65 | for (var i = 0; i < where.$or.length; i++) { |
| 66 | accum = accum.concat(where.$or[i]); |
| 67 | } |
| 68 | return accum; |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Deterministically turns an object into a string. Disregards ordering |