Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

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

Hello!

Let me check this information. I will update.

MobileBen
Posts: 0
Joined: Sat Aug 10, 2013 7:56 pm

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

Hi Maryna,

Can you please provide an update for this.

Thanks.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

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

Hello!

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

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

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...

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

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

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

Dupdroid
Posts: 0
Joined: Sat Mar 30, 2013 9:07 pm

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

Hi,

Has $inc been implemented yet?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

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

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)

Return to “Issues”