Reputation: 6272
How would I design my NoSQL database (MongoDB) to represent this hierarchy ?
public abstract class Customer {
Guid Id;
String Name;
Decimal Balance;
}
public class VipCustomer: Customer {
String Address;
String PhoneNumber;
}
public class NonVipCustomer: Customer {
String VisitingReason;
Int QueueNumber;
}
Upvotes: 1
Views: 735
Reputation: 664
Are you using a Object Data Mapper like Mongoose to manage your schemas? If so, you might try this extension from GitHub to handle inheritance:
https://github.com/briankircho/mongoose-schema-extend
Upvotes: 1