hastic-zzz / hastic-server

Hastic data management server for analyzing patterns and anomalies from Grafana
GNU General Public License v3.0
330 stars 23 forks source link

Error: $or must be an array #778

Closed VargBurz closed 5 years ago

VargBurz commented 5 years ago

Problem

There is an error in the detection process of Anomaly or Pattern Detector with MongoDB:

Error: $or must be an array
    at Object.<anonymous> (/mnt/c/Users/VargB/git/hastic-server/server/dist/server-dev.js:528:19)
    at Generator.next (<anonymous>)
    at fulfilled (/mnt/c/Users/VargB/git/hastic-server/server/dist/server-dev.js:232:32)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

image

Reason

MongoDB and nedb have different $or field syntax in find query.

Changes

jonyrock commented 5 years ago

But I think we need to throw a nice exception if we get another error during the processing of nedb / mongo query. Something like QueryExecutionError