Aidan275 / nativeqda-dev

NativeQDA
http://dev.nativeqda.xyz/
GNU General Public License v3.0
2 stars 0 forks source link

Add user id to file, analysis, datasets, etc models #34

Closed Aidan275 closed 6 years ago

Aidan275 commented 7 years ago

Thinking if we want to display extra information on the user management page for individual users we could list the files the users have uploaded, the datasets they have created and so on.

At the moment the only information linking this data to the users is the user's first name. Since the first name field is not unique we could add the user's id to this data too then we should be able to list all the information quite easily.

Anyone know of a better way to do this or are keen to give it a crack?

Lucas-W commented 7 years ago

Email field is unique, but ObjectIDs are only 12 bytes.

There's also this: http://mongoosejs.com/docs/populate.html

Aidan275 commented 7 years ago

Tested out using reference and populate on the marker links schema in the map model and controller.

So far looks to be a useful idea and may edit the models to include the _creator field that references the users model, this would replace the createdBy fields.