Skip to content

Commit

Permalink
Fixing formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cbullinger committed May 31, 2024
1 parent 0183b3b commit 8f6922b
Show file tree
Hide file tree
Showing 27 changed files with 647 additions and 543 deletions.
54 changes: 54 additions & 0 deletions examples/node/v12/__tests__/models/rql-data-models.js
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 };
Loading

0 comments on commit 8f6922b

Please sign in to comment.