Hi dear Dreamfactory users and dev’s
i’ve implemented Mongodb for a part of my project (quote and invoice part) because of the nosql flexibility.
(after trying Couchdb…)
i can make CreateRecord, GetRecord etc… without any problem
IN API DOC for example
i can also make get Record with filter
{“numerodevis”:{"$gt":20}} for filtering quote (devis) greater than 20
and
{“numerodevis”:{"$in":[2,7]}} : for filtering quotenumber 2 and 7
now i’m looking on how implementing 2 thing
1/ Implementing $sum in filter
a GetRecord with $sum in filter
so i try
{“idSalesCount” : { “$sum” : “$total” }}
who return : invalid operator: $sum",
2/ implementing Mongodb incrementation $inc
i’ve try several time thought updateRecords, UpdateRecordsbyfilter etc…
i now thanks to this post
https://blog.dreamfactory.com/blog/bid/339945/NoSQL-No-Problem-MongoDB-Specifics
that i need to use a PATCH
but when i try DSP create en entry
“$inc”: {
“devis”: NumberLong(1)
},
instead of updating…
****UPDATED N°2 Solved by myself ****
you should do a PUT/ReplaceRecords and not patch/something
So, as $inc and $set are fine
Does anyone have an idea on how doing a $sum ?.
thanks