I'm currently developping a webapp with Sails.js + MongoDB. I'm pretty new to Node.js and NoSQL world so I would like some recommendations.
Basically, an authenticated user will have the possibility inside his Dashboard to allow my webapp to retrieve basic informations from his own social accounts (say Facebook, Twitter and Google+ for now) and in the end get access to an URL like http://mywebbapp.com/user/:id/feed
which provide all his posts/tweets from his social life under the JSON format. Like an aggregator.
I'm currently at the state of the reflexion on how to structure my User model for storing all his social account IDs, or further informations I don't know yet, inside MongoDB.
I thought that a JSON type attribute like this could do the trick, but I'm not sure:
/**
* User.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
attributes: {
socialAccount: {
type: 'json'
}
}
};
I could store into this single attribute all the informations about the user social accounts as nested objects.
FYI, I plan to use AngularJS for the entire Dashboard interface.
Any advice ? :) Apologize for my english.