Forked from mirageglobe/gist:d494d0bc769df6180514
Last active
August 29, 2015 14:18
-
-
Save digilord/cf7281974f606c42e874 to your computer and use it in GitHub Desktop.
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
var _data = {} | |
if ((plot_id > 0) && (plot_id < 11)) { | |
plot_number = "plot_" + plot_id; | |
} | |
if ((street_id !== null) && (plot_number !== null) && (plot_id !== null)) { | |
adc_print("update plot " + plot_number); | |
adc_print({valueOf(plot_number): user_id}); | |
_data[plot_number] = user_id; // This is a variable variable name. You have to use [] notation to do that. | |
_data.status = "active"; | |
mystreet.update( | |
{ _id: street_id }, | |
{ | |
$set: _data | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment