I'm storing some data using the example described in Partial Updates:
https://docs.gamesparks.net/howtos/cloud-data/partial-updates
I would like to add the ability to delete. How would one go about this?
Thanks,
Mike
Hi Mike,
For deleting specific fields in a document you can use the $unset parameter.
collection.update(
{"id": Spark.getPlayer().playerId},
{"$unset" : {<field>:""}},
false,
false
);
You can create a Cloud Code Script that passes the field into this to delete particular fields from a document.
-Pádraig
OK, thanks. That works.
Michael Edwards
I'm storing some data using the example described in Partial Updates:
https://docs.gamesparks.net/howtos/cloud-data/partial-updates
I would like to add the ability to delete. How would one go about this?
Thanks,
Mike
Hi Mike,
For deleting specific fields in a document you can use the $unset parameter.
collection.update(
{"id": Spark.getPlayer().playerId},
{"$unset" : {<field>:""}},
false,
false
);
You can create a Cloud Code Script that passes the field into this to delete particular fields from a document.
-Pádraig
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Mike,
For deleting specific fields in a document you can use the $unset parameter.
collection.update(
{"id": Spark.getPlayer().playerId},
{"$unset" : {<field>:""}},
false,
false
);
You can create a Cloud Code Script that passes the field into this to delete particular fields from a document.
-Pádraig
Michael Edwards
OK, thanks. That works.
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics