I am new to mongo-db and i have few questions.
I have the following code:
public class User
{
private String id;
private String name;
private List<Order> orders;
}
public class Order
{
private String id;
private String orderName;
private Date orderDate;
}
What's the best persisting strategy for User object ?
should i create collection for both User and Order or just for User ?
should i save Order and then user ?
i am using spring data MongoRepository
Thank you.