946
edits
(→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> look like | The object to pass in to <tt>add</tt> and <tt>update</tt> and returned by <tt>find</tt> look like the sample below. Currently, by default, we're storing a single [http://portablecontacts.net/draft-spec.html#schema Portable Contacts object] within the wrapper object, with the addition of a <tt>moz_schema</tt> field. | ||
<pre> | <pre> | ||
// People object | |||
{ | { | ||
// guid identifies this person, schema describes the wrapper object | |||
guid: "af24d-fe488-ab748-b947f", | guid: "af24d-fe488-ab748-b947f", | ||
schema: "http://mozilla.com/schemas/people/1", | schema: "http://mozilla.com/schemas/people/1", | ||
// we pull out some fields for convenience. | |||
// we only index fields we pull out. | |||
firstname: "foo" | firstname: "foo" | ||
lastname: "bar" | lastname: "bar" | ||
| Line 80: | Line 84: | ||
} | } | ||
</pre> | </pre> | ||
== Performance == | == Performance == | ||
edits