Skip to content

Global Address Book

Using Streams

On GDN

Email Passsword Geo Fabric Collection GUI Source Code
demo@macrometa.io xxxxxxxx _system addresses AddressBook github

On GDN (Wavelength 5G)

Email Passsword Geo Fabric Collection GUI Source Code
demo@macrometa.io xxxxxxxx _system addresses AddressBook

Populate addresses collection with data:

// Query to insert addresses
FOR persons IN [ 
  { firstname: "Joseph", lastname: "Smith", email: "[email protected]" },
  { firstname: "Astrid", lastname: "Young", email: "[email protected]" },
  { firstname: "Boris", lastname: "Balastikov", email: "[email protected]" },
  { firstname: "Sherlock", lastname: "Jones", email: "[email protected]" },
  { firstname: "Alpha", lastname: "Simpson", email: "[email protected]" },
  { firstname: "Jose", lastname: "Garcia", email: "[email protected]" },
  { firstname: "Lee", lastname: "Ki", email: "[email protected]" },
  { firstname: "Mark", lastname: "Goldfine", email: "[email protected]" },
  { firstname: "Ramesh", lastname: "Sriram", email: "[email protected]" } 
  ]
  INSERT persons INTO addresses

Queries for RESTQL

Query Name: addAddress

INSERT { firstname: @firstname, 
        lastname: @lastname, 
        email: @email, 
        zipcode: @zipcode }
   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

Email 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.

SaveContact:

INSERT {firstname:@firstName,lastname:@lastName,email:@email} INTO addresses

ReadContact:

FOR entry IN addresses RETURN entry

RemoveContact:

REMOVE @_key IN addresses

UpdateContact:

UPDATE @_key WITH { firstname:@firstName, lastname:@lastName, email:@email} IN addresses