Mongodb Schema for Posts and Shares
问题 I am new to mongodb NoSQL concept and stuck at point where I am unable to take a decision for modelling the schema that could best serve my purpose. I need to design schema in such a way that I have my end result as Posts and Shares sorted by time . For this I considered two options: Option 1: Different Collection for Posts and Share as: Schema for Post collection : var postSchema = mongoose.Schema({ postText: String, postedBy: String, privacy: Number, updatedOn: { type: Date, default: Date