Add views
This commit is contained in:
56
.test/activity.json
Normal file
56
.test/activity.json
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"_group": "system_collections",
|
||||
"_name": "activity",
|
||||
"_version": "202507",
|
||||
"singular": "activity",
|
||||
"plural": "activities",
|
||||
"idPrefix": "act",
|
||||
"system": true,
|
||||
"indexSpecs": [{
|
||||
"name": "name_1",
|
||||
"keys": { "name": 1 },
|
||||
"unique": true
|
||||
}],
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_id": {
|
||||
"bsonType": "string"
|
||||
},
|
||||
"person": {
|
||||
"bsonType": "string"
|
||||
},
|
||||
"name": {
|
||||
"bsonType": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"bsonType": "date"
|
||||
},
|
||||
"updatedAt": {
|
||||
"bsonType": "date"
|
||||
},
|
||||
"archivedAt": {
|
||||
"bsonType": "date"
|
||||
}
|
||||
}
|
||||
},
|
||||
"views": {
|
||||
"activityExpanded": {
|
||||
"viewOn": "activity",
|
||||
"pipeline": [{
|
||||
"$lookup": {
|
||||
"from": "person",
|
||||
"localField": "person",
|
||||
"foreignField": "_id",
|
||||
"as": "refPerson"
|
||||
}
|
||||
}, {
|
||||
"$unwind": "$refPerson"
|
||||
}, {
|
||||
"$set": { "person": "$refPerson" }
|
||||
}, {
|
||||
"$unset": "refPerson"
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
37
.test/person.json
Normal file
37
.test/person.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"_group": "system_collections",
|
||||
"_name": "person",
|
||||
"_version": "202507",
|
||||
"singular": "person",
|
||||
"plural": "persons",
|
||||
"idPrefix": "prs",
|
||||
"system": true,
|
||||
"indexSpecs": [{
|
||||
"name": "name_1",
|
||||
"keys": { "name": 1 },
|
||||
"unique": true
|
||||
}],
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_id": {
|
||||
"bsonType": "string"
|
||||
},
|
||||
"name": {
|
||||
"bsonType": "string"
|
||||
},
|
||||
"age": {
|
||||
"bsonType": "number"
|
||||
},
|
||||
"createdAt": {
|
||||
"bsonType": "date"
|
||||
},
|
||||
"updatedAt": {
|
||||
"bsonType": "date"
|
||||
},
|
||||
"archivedAt": {
|
||||
"bsonType": "date"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
20
.test/sample.json
Normal file
20
.test/sample.json
Normal file
@@ -0,0 +1,20 @@
|
||||
[{
|
||||
"name": "PKCELL Ultra Alkaline Batteries Size D LR20-2B (2-Pack)",
|
||||
"sku": "ALK-PK-LR202B-01",
|
||||
"price": {
|
||||
"value": 288,
|
||||
"currency": "cad"
|
||||
},
|
||||
"active": true,
|
||||
"tags": ["alkaline", "size-d", "pkcell"]
|
||||
}, {
|
||||
"name": "Shimano Cleats SH-11 Yellow 6 degrees",
|
||||
"sku": "BK-SM-SH51",
|
||||
"active": true,
|
||||
"tags": ["shimano", "cleats", "sh11", "cycling"]
|
||||
}, {
|
||||
"name": "OSRAM Light Bulbs H7 Original Classic 12V 55W Spare Part Replacement",
|
||||
"sku": "LT-OSR-H712V35W",
|
||||
"active": false,
|
||||
"tags": ["osram", "h7", "halogen-bulb", "12v", "55w"]
|
||||
}]
|
||||
53
.test/user.json
Normal file
53
.test/user.json
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"_group": "system_collections",
|
||||
"_name": "user",
|
||||
"_version": "202507",
|
||||
"singular": "user",
|
||||
"plural": "users",
|
||||
"idPrefix": "usr",
|
||||
"system": true,
|
||||
"indexSpecs": [{
|
||||
"name": "username_1",
|
||||
"keys": { "username": 1 },
|
||||
"unique": true
|
||||
}, {
|
||||
"name": "email_1",
|
||||
"keys": { "email": 1 },
|
||||
"unique": true
|
||||
}],
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_id": {
|
||||
"bsonType": "string"
|
||||
},
|
||||
"fullname": {
|
||||
"bsonType": "string"
|
||||
},
|
||||
"firstname": {
|
||||
"bsonType": "string"
|
||||
},
|
||||
"username": {
|
||||
"bsonType": "string"
|
||||
},
|
||||
"password": {
|
||||
"bsonType": "string"
|
||||
},
|
||||
"email": {
|
||||
"bsonType": "string"
|
||||
},
|
||||
"credentials": {
|
||||
"bsonType": ["object", "null"]
|
||||
},
|
||||
"createdAt": {
|
||||
"bsonType": "date"
|
||||
},
|
||||
"updatedAt": {
|
||||
"bsonType": "date"
|
||||
},
|
||||
"archivedAt": {
|
||||
"bsonType": "date"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user