Hi, I am creating a backend for a mobile app where we need to store device IDs for push notifications. Every device has only one push token, and that must be associated with only one user. We have IOS and Android push tokens. We may one day have others (Windows Phone?) but thats a very long way away. Although they both serve similar purposes, they might have different metadata associated with them (I don't know of anything specific, but maybe one will have an expiration date and another will have some other field). I'm using Mongoose. My first intuition was to implement like this:var DeviceId = new mongoose.Schema({ token: String, userId: { type: ObjectId, index: true },
type: { type: String, enum: ['ios', 'android'] } }, { shardKey: { _id: 1 } }); DeviceId.index({ token: 1, type: 1 }, { unique: true });However, i'm wondering if that's overkill to have a compound index to ensure uniqueness. Maybe I should just have two collections, one for IOS and one for Android? Because maybe the 'schema' is different?Any thoughts?Thanks