Sign In Register

How can we help you today?

Start a new topic
Answered

Add a field to a collection

How do I add a field to every entry in a collection? $set doesn't work in update, "{"$set ": {"familyAlias":""}}" throws "The action could not be executed. Please check your parameters."


Also is it possible to change a runtime collection's name? Is there a way to modify stuff in the MongoDB freely, like using CRUD operations?


Best Answer

Hi Inés,


Your syntax is correct, you just have a typo in your json - there's a space between $set and it's closing quotation mark that will prevent it from working. 


Unfortunately it is not possible to rename runtime collections. You can perform any CRUD operations you need using the various tabs in the NoSQL explorer; is there something in particular you're trying to implement that can't be done using these? You can also perform operations on your collections via cloud code using our SparkMongoCollectionReadWrite class (accessed using Spark.runtimeCollection(<myCollectionName>)).


Regards,

Vinnie

1 Comment

Answer

Hi Inés,


Your syntax is correct, you just have a typo in your json - there's a space between $set and it's closing quotation mark that will prevent it from working. 


Unfortunately it is not possible to rename runtime collections. You can perform any CRUD operations you need using the various tabs in the NoSQL explorer; is there something in particular you're trying to implement that can't be done using these? You can also perform operations on your collections via cloud code using our SparkMongoCollectionReadWrite class (accessed using Spark.runtimeCollection(<myCollectionName>)).


Regards,

Vinnie

Login to post a comment