Page 2 of 2

How can I increment a value in a collection using mongoDB's $inc command ?

Posted: Tue May 20, 2014 8:37 am
by Maryna Brodina

Hello!

Let me check this information. I will update.


How can I increment a value in a collection using mongoDB's $inc command ?

Posted: Sat May 24, 2014 8:47 pm
by MobileBen

Hi Maryna,

Can you please provide an update for this.

Thanks.


How can I increment a value in a collection using mongoDB's $inc command ?

Posted: Sun May 25, 2014 6:00 pm
by Maryna Brodina

Hello!

Sorry for delay. I will update the post when have information.


How can I increment a value in a collection using mongoDB's $inc command ?

Posted: Fri May 30, 2014 12:20 pm
by Maryna Brodina

Hello!

Sorry for delay! Your request has been passed to developers team and they are working on estimation. It might be we include this functionality in the next release, but for now can't say for sure...


How can I increment a value in a collection using mongoDB's $inc command ?

Posted: Wed Jun 11, 2014 8:57 am
by Maryna Brodina

Hello! It should be implemented in the next release (late July)


How can I increment a value in a collection using mongoDB's $inc command ?

Posted: Mon Aug 04, 2014 5:42 am
by Dupdroid

Hi,

Has $inc been implemented yet?


How can I increment a value in a collection using mongoDB's $inc command ?

Posted: Mon Aug 04, 2014 8:57 am
by Maryna Brodina

Hello!

Yes, it has been implemented.

To update objects in collection, send PUT request to according URL:
precurl -X PUT \
-H "Content-Type: application/json" \
-H "X-Appery-Database-Id: <database_id>" \
[-H "X-Appery-Session-Token: <session_token>" \]
-d '{“where”:<query>, “update”:<object>, “operations”:<operations>}' \
https:&#47;&#47;api&#46;appery&#46;io/rest/1/db/collections/<collection_name>/pre

where:
database_id is unique identifier of database.
session_token is session token which you use to do some actions with database.
collection_name is name of database's collection.
query is JSON query object that was built in accordance with the documentation of mongo quering. .
object is an JSON object with fields of object that should be updated.

operations is JSON update object with native mongo operations and fields of object that should be updated. Object was built in accordance with the documentation of mongo set operations. If operations object specified, update object fully ignored. Their functionality can not be used simultaneously.

You can use the following operations:

$set
$unset
$inc (Number type only)
$mul (Number type only)
$min (Number and Date type only)
$max (Number and Date type only)