forked from mongodb/docs-realm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0183b3b
commit 8f6922b
Showing
27 changed files
with
647 additions
and
543 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Models for embedded objects & dot notation queries | ||
const Address = { | ||
name: "Address", | ||
embedded: true, | ||
properties: { | ||
name: "string", | ||
street: "string", | ||
zipcode: "int", | ||
}, | ||
}; | ||
|
||
const Office = { | ||
name: "Office", | ||
properties: { | ||
name: "string", | ||
address: "Address", | ||
}, | ||
}; | ||
|
||
// :snippet-start: rql-data-models | ||
const Item = { | ||
name: "Item", | ||
properties: { | ||
_id: "objectId", | ||
name: { type: "string", indexed: "full-text" }, | ||
isComplete: { type: "bool", default: false }, | ||
assignee: "string?", | ||
priority: { type: "int", default: 0 }, | ||
progressMinutes: { type: "int", default: 0 }, | ||
projects: { | ||
type: "linkingObjects", | ||
objectType: "Project", | ||
property: "items", | ||
}, | ||
}, | ||
primaryKey: "_id", | ||
}; | ||
|
||
const Project = { | ||
name: "Project", | ||
properties: { | ||
_id: "objectId", | ||
name: "string", | ||
items: "Item[]", | ||
quota: "int?", | ||
comments: "string?{}", | ||
projectLocation: "Office?", | ||
additionalInfo: "mixed", | ||
}, | ||
primaryKey: "_id", | ||
}; | ||
// :snippet-end: | ||
|
||
export { Address, Item, Office, Project }; |
Oops, something went wrong.