mingo-app / mingo

Found a bug? have a FR ?
59 stars 3 forks source link

$expr doesn't works as expected! #622

Closed Mr0nline closed 6 months ago

Mr0nline commented 6 months ago

The following query works fine in NoSQLBooster but somehow it seems to fail in Mingo with following error!

{
    order_number: 'SO1055',
    $expr: {
        $function: {
            body: function(lineItems) {
                const matchedLineItem = lineItems.find((line) => line._id.valueOf() === "628c9e8a75032855bbd16018")
                return matchedLineItem
            },
            args: ["$line_items"],
            lang: 'js'
        }
    }
}

MongoDB Result in NoSQLBooster! image

MongoDB Result in Mingo! image

Mr0nline commented 6 months ago

It seems that I forgot to use backticks ` in body which resulted in error, Somehow NoSQLBooster was managing query without it so closing this issue as MongoDB will also fail the query with same error if there are no backticks provided!