I'm creating a snippet manager using Node and React just as a bit of a learning project that we might be able to use where I work.
I had it set up previously using Express, Mongoose and mLab. With the mindset of learning and challenging myself I wanted to move to using AWS' DynamoDB.
I found Dynaamoose which is going to be a big help as the API is almost identical to Mongoose. However, I can't seem to figure out how to recreate what Schema.Types.ObjectId does.
const SnippetSchema = new Schema({
id: {
type: String,
default: shortid.generate(),
hashKey: true
},
user: {
type: Schema.Types.ObjectId,
ref: 'users'
},
category: {
type: Schema.Types.ObjectId,
ref: 'categories'
},
code: {
type: String,
required: true
},
title: {
type: String,
required: true
}});
It's not formatted perfectly but essentially how do I get that to reference my user and my category in the same way?