[SOLVED] How to let users create Collections, Publications and Routes


#1

Hello everyone,

I’m working on a monitoring app. It receives data from an external source (via server side route) and displays it on the client with charts and other graphs.

Let’s say we are monitoring 1 data :

  • Temperature : it has its Collection, its Publication and its server side Route for receiving the data.

Now the user wants to add a new type of data : Humidity. It will also need the same thing as Temperature.

How those things are done ? The app changes its own code ?
I never knew how CMS (since it’s sort of a CMS) are done, here we create Collections, Publications and server side Routes (API) instead of adding pages and content.

Yhanks


#2

Maybe you could switch your point of view. Make a collection called Measures (I can’t think of a better name) and add a ‘type’ field in it that says if it is Temperature, Humidity or whatever. Then filter on that field when you want to show data of one type.


#3

This is my thinking, too. In NoSQL we have the freedom to pile as many different types of documents into a single collection as we feel like.


#4

That easy ? Wow :smile:
So I juste have to tell the client to add a ‘‘type’’ field to the data he receives and then filter the Collection by ‘‘type’’ when he wants to display it.

Great ! Thanks !

p.s : is there a way to mark this as solved ?