src code

instance method Spah.SpahQL#set

Spah.SpahQL#set(key, value) → Spah.SpahQL
  • key (String, Number): The key to set on this result
  • value: The value to set for the given key Spah.SpahQL#set(dictionary) -> Spah.SpahQL
  • dictionary (Object): A key/value hash containing multiple keys to be set.

Take the data for the first result item in this set, and set a key on it. Has no effect if the data being modified is a basic type such as a string or number.

var db = Spah.SpahQL.db({foo: {a: “b”}}); var foo = db.select(“/foo”); foo.set(“new-key”, “moose”); //-> data is now {foo: {a: “b”, “new-key”: “moose”}}

Returns self.