Hi Team,
We are working on a project. We need your suggestion on defining our schema for the report collection. We have 5 types of reports. Now we are thinking to keep one collection for them instead of 5 collections. Is it a good idea to keep them in a single collection or it’s better to keep them in a different collection? We are finding an alternative as we don’t want to run into performance issues.
1 Collection with all types of Reports
{
Type: Job1 ('Job1', Print, Scan, AddValue, Fine),
TransactionDate: String,
TransactionStartTime: String,
TransactionEndTime: String,
TimeZone: String,
BarcodeNumber: String,
FullName: String,
EmailAddress: String,
Balance: Balance
Job1: {
10 more fields
}
}
{
Type: Print ('Job1', Print, Scan, AddValue, Fine),
TransactionDate: String,
TransactionStartTime: String,
TransactionEndTime: String,
TimeZone: String,
BarcodeNumber: String,
FullName: String,
EmailAddress: String,
Balance: Balance
Print: {
10 more fields
}
}
Separate these collections into 5
{
Type: Job1,
TransactionDate: String,
TransactionStartTime: String,
TransactionEndTime: String,
TimeZone: String,
BarcodeNumber: String,
FullName: String,
EmailAddress: String,
Balance: Balance
Job1Field1: value,
Job1Field2: value,
Job1Field3: value
so on...
}
{
Type: Print,
TransactionDate: String,
TransactionStartTime: String,
TransactionEndTime: String,
TimeZone: String,
BarcodeNumber: String,
FullName: String,
EmailAddress: String,
Balance: Balance
PrintField1: value,
PrintField2: value,
Printield3: value,
and so on...
}