-
Notifications
You must be signed in to change notification settings - Fork 1
Front end DB Seeds
luzlab edited this page Jun 2, 2017
·
2 revisions
Here is the database structure for the UI frontend.
devices:
{
amputationLevels: { slug: "transradial",
name: "Transradial" },
slug: 'xrp-arm',
name: 'XRP arm',
icon: 'https://www.AWSurlhere',
creator: 'limbforge',
componentType: 'passive',
weight: '250 g - 350 g',
description: 'The XRP Arm is a lightweight, highly cosmetic passive device with several terminal device options.',
tags: [ 'social occasions', 'supporting objects', ... ],
printTime: '14 hrs - 20 hrs',
measurements: [ { name: 'c1'
step: 0.5,
upper_range: 28,
measurement_unit: "cm",
lower_range: 20,
default: 25,
instructions: 'instructions go here'
}, ...
],
terminalDevices: [ { slug: "active-device",
name: "Active device" } , ...
]
}
MongoCollection.distinct('amputationLevels'); // returns an array of objects
const fields = { slug: true, name: true, icon: true, creator: true, component_type: true, weight: true, description: true , uses: true, printTime: true };
MongoCollection.find({slug : { $eq : <AL> }}, {fields});
MongoCollection.find({slug : { $eq : <DEVICE> }}, {fields {measurements: true}});
MongoCollection.find({slug : { $eq : <DEVICE> }}, {fields {terminalDevices: true}});