Global Address Book
Using Streams
On GDN
Passsword | Geo Fabric | Collection | GUI | Source Code | |
---|---|---|---|---|---|
demo@macrometa.io | xxxxxxxx | _system | addresses | AddressBook | github |
Populate addresses
collection with data:
// Query to insert addresses
FOR persons IN [
{ firstName: "Joseph", lastName: "Smith", email: "jsmith2020@gmail.com" },
{ firstName: "Astrid", lastName: "Young", email: "missmoneybags@young.co.sg" },
{ firstName: "Boris", lastName: "Balastikov", email: "bb@refundit.com" },
{ firstName: "Sherlock", lastName: "Jones", email: "pd@elementary.org" },
{ firstName: "Alpha", lastName: "Simpson", email: "alf@simpsonrealtech.com" },
{ firstName: "Jose", lastName: "Garcia", email: "j.garcia@nebulus.com" },
{ firstName: "Lee", lastName: "Ki", email: "Lee.ki@symbol.com" },
{ firstName: "Mark", lastName: "Goldfine", email: "mark@tidalwave.com" },
{ firstName: "Ramesh", lastName: "Sriram", email: "ramesh@lifely.com" }
]
INSERT persons INTO addresses
Queries for RESTQL
Query Name: addAddress
INSERT { firstName: @firstName, lastName: @lastName, email: @email }
INTO addresses
Query Name: getAddresses
FOR address IN addresses
RETURN address
Query Name: updateEmail
UPDATE { _key: @key }
WITH { email: @email }
IN addresses
Query Name: removeAddress
REMOVE { _key: @key}
IN addresses
Using RESTQL
GDN
Passsword | Geo Fabric | Collection | GUI | Source Code | |
---|---|---|---|---|---|
demo@macrometa.io | xxxxxx | _system | addresses | AddressBook (RESTQL) | github |
Note: The demo app automatically creates the following RESTQLs as part of startup.
insertAddress:
INSERT { firstName: @firstName, lastName: @lastName, email: @email}
INTO addresses
getAddresses:
FOR entry IN addresses
RETURN entry
removeAddress:
REMOVE @_key IN addresses
updateAddress:
UPDATE @_key
WITH { firstName: @firstName, lastName: @lastName, email: @email }
IN addresses