Documents with properties of different types

49 views
Skip to first unread message

Andreas Toftegaard

unread,
Oct 25, 2016, 5:22:39 PM10/25/16
to ShareJS
Hi
I've played around with the old ShareJS before and found it very interesting, especially now, with the beta release of ShareDB 1.0. The documentation is however quite sparse. I'd like to have documents with properties of different types, and I'm not sure if this is possible or if this should be modeled differently.

Assume I maintain a collection of Cars that people for some reason would like to collaborate on. Each car has a brand and description:
Cars = [{ brand: 'Toyota', description: 'Today, Tomorrow, Toyota'}, { brand: 'BMW', description: 'German engineering' }]

I would like to maintain brands with ot-type text, and descriptions with rich-text. How can I achieve this, with the data structure above? I initially thought of using json0, but that does not play nicely with Quill and textfields.

Thanks!
Message has been deleted

Andreas Toftegaard

unread,
Oct 25, 2016, 5:33:18 PM10/25/16
to ShareJS
Oh, and I assume that I would end up with around 20-30 different properties per document. I would like users to view and edit all of them, some will be rich-texts, some dropdowns others simple text-fields.
Reply all
Reply to author
Forward
0 new messages