Created
October 8, 2014 09:57
-
-
Save khris/f05dc3d3275ae5e8c7ae to your computer and use it in GitHub Desktop.
Set a field name in a MongoDB document with dollar sign($)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.application.update( | |
{field1: 'value1'}, | |
{$set: {'subdoc.$field_name_with_dollar_sign': 'value2'}} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment