946
edits
(→API) |
|||
| Line 27: | Line 27: | ||
== Structure == | == Structure == | ||
The backend store is implemented as a JS module. | |||
== API == | == API == | ||
| Line 56: | Line 56: | ||
Currently, the store uses transactions internally to add each person (because data is split up over multiple tables), so there is no public API for dealing with database transactions. In the future, we may add this functionality. | Currently, the store uses transactions internally to add each person (because data is split up over multiple tables), so there is no public API for dealing with database transactions. In the future, we may add this functionality. | ||
The object to pass in to <tt>add</tt> and <tt>update</tt> and returned by <tt>find</tt> | The object to pass in to <tt>add</tt> and <tt>update</tt> and returned by <tt>find</tt> look like this: | ||
<pre> | |||
{ | |||
guid: "af24d-fe488-ab748-b947f", | |||
schema: "http://mozilla.com/schemas/people/1", | |||
firstname: "foo" | |||
lastname: "bar" | |||
documents: [ | |||
{ | |||
moz_schema: "http://portablecontacts.net/draft-spec.html", | |||
firstname: "foo", | |||
lastname: "bar", | |||
emails: [ | |||
{value: "foo@gmail.com"}, | |||
{value: "foo@yahoo.com"}, | |||
{value: "bar@yahoo.com"} | |||
] | |||
} | |||
] | |||
} | |||
</pre> | |||
Currently, by default, we're storing a single [http://portablecontacts.net/draft-spec.html#schema Portable Contacts object], with the addition of a <tt>moz_schema</tt> field. | |||
== Performance == | == Performance == | ||
edits