parse.com - nosql database for VBA, you may want to read that too, which has similar examples. Note that virtually all methods can be chained leading to pretty compact code. Because the GAS API is so similar to Retrieving an object by unique IDIn parse every object (row) is assigned a unique ID. If you know it you can retrieve that object. You can find it in your parse.com dashboard and substitute in a valid unique ID in the example below The results [13-11-29 19:26:23:811 GMT] {"customerid":1,"date":"Sat Aug 10 2013 00:00:00 GMT+0100 (BST)","invoiceid":145,"quantity":9,"value":4230,"createdAt":"2013-11-29T17:25:57.655Z","updatedAt":"2013-11-29T17:25:57.655Z","objectId":"ZflFVMnczp"} Querying objectsYou can query by example, and add options like sort order The results [13-11-29 19:16:50:352 GMT] all is ok{"results":[{"customerid":1,"quantity":9,"value":4230,"invoiceid":145,"date":"Sat Aug 10 2013 00:00:00 GMT+0100 (BST)","createdAt":"2013-11-29T17:25:57.655Z","updatedAt":"2013-11-29T17:25:57.655Z","objectId":"ZflFVMnczp"},{"customerid":1,"quantity":10,"value":3900,"invoiceid":246,"date":"7/25/2013","createdAt":"2013-11-29T17:26:00.448Z","updatedAt":"2013-11-29T17:26:00.448Z","objectId":"NgDkL6qg8u"},{"customerid":1,"quantity":3,"value":1560,"invoiceid":151,"date":"5/21/2013","createdAt":"2013-11-29T17:25:57.874Z","updatedAt":"2013-11-29T17:25:57.874Z","objectId":"XDRMUJSbaA"},{"customerid":1,"quantity":2,"value":1050,"invoiceid":175,"date":"8/22/2013","createdAt":"2013-11-29T17:25:58.538Z","updatedAt":"2013-11-29T17:25:58.538Z","objectId":"QjqVyykjip"}]} Counting objectsYou can count total number in the class, or matching a query The results [13-11-29 19:20:51:038 GMT] 308.0 [13-11-29 19:20:51:210 GMT] 1.0
|
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > Parse.com > parse.com - noSQL database for GAS >