-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathrql-data-models.js
54 lines (50 loc) · 1.05 KB
/
rql-data-models.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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 };