Skip to content

Instantly share code, notes, and snippets.

@digilord
Forked from mirageglobe/gist:d494d0bc769df6180514
Last active August 29, 2015 14:18
Show Gist options
  • Save digilord/cf7281974f606c42e874 to your computer and use it in GitHub Desktop.
Save digilord/cf7281974f606c42e874 to your computer and use it in GitHub Desktop.
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