Google Apps Script

Class ScriptDbMap

An item that was saved to or retrieved from the database. The original object's fields can be accessed as usual, using either the dot or bracket notation.

 
var db = ScriptDb.getMyDb();
 var item = db.save({
   type: 'person',
   name: 'fred',
   age: 25
 });
 Logger.log('Name: ' + item.name);
 Logger.log('Age: ' + item['age']);
 

Methods

MethodReturn typeBrief description
getId()StringReturns the item's id in the database.
toJson()StringReturns the JSON string representation of this object.

Detailed documentation

getId()

Returns the item's id in the database. These ids are guaranteed to be unique within a given database.

Return

String — the item's id in the database


toJson()

Returns the JSON string representation of this object.

Return

String — the JSON string representation of this object

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.