Update README.md
This commit is contained in:
parent
28ccf799f4
commit
dc7ff590a0
18
README.md
18
README.md
|
@ -90,14 +90,16 @@ You can see more examples of how to use these APIs in the [ReactExample](https:/
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
### `Realm` Constructor Options
|
### `Realm` Constructor Options
|
||||||
- `path` – defaults to `Realm.defaultPath` (which initially is `'Documents/default.realm'`)
|
#### `new Realm(config)`
|
||||||
- `schema` – array of object type definitions (see below, optional if realm already created)
|
The configuration passed can contain the following:
|
||||||
- `schemaVersion` – defaults to `0` (must be incremented after changing the schema)
|
- `schema` – required when first accessing a realm - array of `ObjectSchema` or object constructors (see below)
|
||||||
|
- `path` – optional - defaults to `Realm.defaultPath` (which initially is `'Documents/default.realm'`)
|
||||||
|
- `schemaVersion` – optiona - defaults to `0` but must be specified and incremented after changing the schema
|
||||||
|
|
||||||
### Object Types
|
### ObjectSchema
|
||||||
- `name` – string used to refer to this object type
|
- `name` – required - string used to refer to this object type
|
||||||
- `primaryKey` – optional name of `STRING` or `INT` property that should be unique
|
- `properties` - required – array of property defitions (see below)
|
||||||
- `properties` – array of property defitions (see below)
|
- `primaryKey` – optional - name of `STRING` or `INT` property that should be unique
|
||||||
|
|
||||||
### Property Types
|
### Property Types
|
||||||
When definining object `properties` in a `schema`, each should have a unique `name`, and the `type` of each property must be defined as either the name of an object type in the same schema **or** as one of the following:
|
When definining object `properties` in a `schema`, each should have a unique `name`, and the `type` of each property must be defined as either the name of an object type in the same schema **or** as one of the following:
|
||||||
|
@ -124,7 +126,7 @@ You _may_ specify these property options as well:
|
||||||
- `update` – optional boolean signaling that an existing object (matching primary key) should be updated - only the primary key property and properties which should be updated need to be specified for the `props` arguments - all missing property values will remain unchanged
|
- `update` – optional boolean signaling that an existing object (matching primary key) should be updated - only the primary key property and properties which should be updated need to be specified for the `props` arguments - all missing property values will remain unchanged
|
||||||
- _Returns a new realm object instance_
|
- _Returns a new realm object instance_
|
||||||
|
|
||||||
#### `delete(object)`
|
#### `delete(object, ..., objectN)`
|
||||||
- `object` – realm object or array of realm objects (which can be a `List` or `Results` object)
|
- `object` – realm object or array of realm objects (which can be a `List` or `Results` object)
|
||||||
|
|
||||||
#### `deleteAll()`
|
#### `deleteAll()`
|
||||||
|
|
Loading…
Reference in New Issue