Skip to content

Commit

Permalink
update init-mongo.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim2121512 committed Dec 18, 2024
1 parent ed7d40c commit a393b1d
Showing 1 changed file with 42 additions and 31 deletions.
73 changes: 42 additions & 31 deletions db/init-mongo.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ db.getCollection(process.env.WORKER_COLLECTION).insertOne(
"phone": "+71234567890",
"jobTitle": "Главный работник",
"date": ISODate("2024-11-28T15:39:13.05Z"),
"image": "http://localhost:8080/api/resources/images/workers/c0999ff2f2c730678f0356603e424516b674ccb0d599b87dedb7a9a1bc89646f/1.png",
"image": "http://0.0.0.0:8080/api/resources/images/workers/c0999ff2f2c730678f0356603e424516b674ccb0d599b87dedb7a9a1bc89646f/1.png",
"created_at": ISODate("2024-11-28T15:39:13.05Z"),
"updated_at": ISODate("2024-11-28T15:39:13.05Z")
}
Expand All @@ -48,7 +48,7 @@ db.getCollection(process.env.CLIENT_COLLECTION).insertMany([
"name": "Иван",
"surname": "Петров",
"phone": "+79161234567",
"image": "http://localhost:8080/api/resources/images/clients/d89b750bd5a875c166119bf523fa5dabd5b3e2d263ea63b68aa26cd0411af1f3/1.png"
"image": "http://0.0.0.0:8080/api/resources/images/clients/d89b750bd5a875c166119bf523fa5dabd5b3e2d263ea63b68aa26cd0411af1f3/1.png"
},
{
"_id": ObjectId("6762d6d9f6292fe72b752b5f"),
Expand All @@ -60,7 +60,7 @@ db.getCollection(process.env.CLIENT_COLLECTION).insertMany([
"name": "Ольга",
"surname": "Смирнова",
"phone": "+79991234567",
"image": "http://localhost:8080/api/resources/images/clients/4d1732f83c592083c1d3c77ec3b45ec1c950f7c974c938fc1affaed81cf6f084/1.png"
"image": "http://0.0.0.0:8080/api/resources/images/clients/4d1732f83c592083c1d3c77ec3b45ec1c950f7c974c938fc1affaed81cf6f084/1.png"
},
{
"_id": ObjectId("6762d6ebf6292fe72b752b60"),
Expand All @@ -72,7 +72,7 @@ db.getCollection(process.env.CLIENT_COLLECTION).insertMany([
"name": "Алексей",
"surname": "Васильев",
"phone": "+79271234567",
"image": "http://localhost:8080/api/resources/images/clients/263dc3e1633465f5cc6cfc17daec3627764a43cdbba3ebcbe9eca18aa2acb105/1.png"
"image": "http://0.0.0.0:8080/api/resources/images/clients/263dc3e1633465f5cc6cfc17daec3627764a43cdbba3ebcbe9eca18aa2acb105/1.png"
}
]);

Expand Down Expand Up @@ -110,9 +110,7 @@ db.getCollection(process.env.CATEGORY_COLLECTION).insertMany([
"types": [
ObjectId("6762d98e6b4835df660bce6d"),

ObjectId("6762d9946b4835df660bce6e"),

ObjectId("6762d99e6b4835df660bce6f")
ObjectId("6762d9946b4835df660bce6e")

]
},
Expand Down Expand Up @@ -246,13 +244,6 @@ db.getCollection(process.env.TYPE_COLLECTION).insertMany([

]
},
{
"_id": ObjectId("6762d99e6b4835df660bce6f"),

"name": "Лазерный дальномер",
"category_name": "Измерительные инструменты",
"tools": []
},
{
"_id": ObjectId("6762d9bd6b4835df660bce70"),

Expand Down Expand Up @@ -289,8 +280,9 @@ db.getCollection(process.env.TYPE_COLLECTION).insertMany([
"tools": [
ObjectId("6762dd6ed5595612f0a21225"),

ObjectId("6762dd89d5595612f0a21226")
ObjectId("6762dd89d5595612f0a21226"),

ObjectId("6762dd89d5595612f0a21227")
]
}
]);
Expand All @@ -303,8 +295,8 @@ db.getCollection(process.env.TOOL_COLLECTION).insertMany([
"dailyPrice": 40.0,
"totalPrice": 850.0,
"images": [
"http://localhost:8080/api/resources/images/tools/5d25e3d8154a07b5edc4ed1c9c09930494980b1942f1d979b867c4391baf1e2f/1.png",
"http://localhost:8080/api/resources/images/tools/5d25e3d8154a07b5edc4ed1c9c09930494980b1942f1d979b867c4391baf1e2f/2.png"
"http://0.0.0.0:8080/api/resources/images/tools/5d25e3d8154a07b5edc4ed1c9c09930494980b1942f1d979b867c4391baf1e2f/1.png",
"http://0.0.0.0:8080/api/resources/images/tools/5d25e3d8154a07b5edc4ed1c9c09930494980b1942f1d979b867c4391baf1e2f/2.png"
],
"features": {
"Вес": "500 г",
Expand Down Expand Up @@ -537,8 +529,8 @@ db.getCollection(process.env.TOOL_COLLECTION).insertMany([
"dailyPrice": 400.0,
"totalPrice": 9500.0,
"images": [
"http://localhost:8080/api/resources/images/tools/d56b0d31b3a81077bb50df1f37a30f94fe23ebdbef02d6c6e5d4ef3385279c5c/1.png",
"http://localhost:8080/api/resources/images/tools/d56b0d31b3a81077bb50df1f37a30f94fe23ebdbef02d6c6e5d4ef3385279c5c/2.png"
"http://0.0.0.0:8080/api/resources/images/tools/d56b0d31b3a81077bb50df1f37a30f94fe23ebdbef02d6c6e5d4ef3385279c5c/1.png",
"http://0.0.0.0:8080/api/resources/images/tools/d56b0d31b3a81077bb50df1f37a30f94fe23ebdbef02d6c6e5d4ef3385279c5c/2.png"
],
"features": {
"Аккумулятор": "10.8 В",
Expand Down Expand Up @@ -708,8 +700,8 @@ db.getCollection(process.env.TOOL_COLLECTION).insertMany([
"dailyPrice": 200.0,
"totalPrice": 8000.0,
"images": [
"http://localhost:8080/api/resources/images/tools/5ce2f7f4ec7ee5709c101dc011b25001041196e54cab1a44c3911bec2fcc5444/1.png",
"http://localhost:8080/api/resources/images/tools/5ce2f7f4ec7ee5709c101dc011b25001041196e54cab1a44c3911bec2fcc5444/2.png"
"http://0.0.0.0:8080/api/resources/images/tools/5ce2f7f4ec7ee5709c101dc011b25001041196e54cab1a44c3911bec2fcc5444/1.png",
"http://0.0.0.0:8080/api/resources/images/tools/5ce2f7f4ec7ee5709c101dc011b25001041196e54cab1a44c3911bec2fcc5444/2.png"
],
"features": {
"Дальность": "50 м",
Expand Down Expand Up @@ -879,8 +871,8 @@ db.getCollection(process.env.TOOL_COLLECTION).insertMany([
"dailyPrice": 30.0,
"totalPrice": 600.0,
"images": [
"http://localhost:8080/api/resources/images/tools/1049c30b152de23ffe9667fba626782eb566c9ef5476b0fb08a714051475f500/1.png",
"http://localhost:8080/api/resources/images/tools/1049c30b152de23ffe9667fba626782eb566c9ef5476b0fb08a714051475f500/2.png"
"http://0.0.0.0:8080/api/resources/images/tools/1049c30b152de23ffe9667fba626782eb566c9ef5476b0fb08a714051475f500/1.png",
"http://0.0.0.0:8080/api/resources/images/tools/1049c30b152de23ffe9667fba626782eb566c9ef5476b0fb08a714051475f500/2.png"
],
"features": {
"Материал": "Полипропилен",
Expand Down Expand Up @@ -961,13 +953,12 @@ db.getCollection(process.env.TOOL_COLLECTION).insertMany([
},
{
"_id": ObjectId("6762dd89d5595612f0a21226"),

"name": "Перчатки кожаные сварщика",
"dailyPrice": 30.0,
"totalPrice": 500.0,
"images": [],
"features": {
"Материал": "Натуральная кожа",
"Материал": "Натуральная кожа",
"Защита": "От высоких температур",
"Размер": "L",
"Назначение": "Сварочные работы"
Expand All @@ -979,6 +970,26 @@ db.getCollection(process.env.TOOL_COLLECTION).insertMany([
"created_at": ISODate("2024-12-18T14:34:49.124Z"),
"updated_at": ISODate("2024-12-18T14:34:49.124Z"),
"reviews_count": 0
},
{
"_id": ObjectId("6762dd89d5595612f0a21227"),
"name": "Перчатки х/б с ПВХ покрытием",
"dailyPrice": 5,
"totalPrice": 80,
"images": [],
"features": {
"Материал": "Хлопок и ПВХ",
"Защита": "От механических повреждений",
"Размер": "Универсальный",
"Назначение": "Строительные и садовые работы"
},
"rating": 0.0,
"category": "Защитное оборудование",
"type": "Перчатки рабочие",
"description": "Доступные и удобные перчатки с ПВХ покрытием для универсального использования. Обеспечивают хороший захват.",
"created_at": ISODate("2024-12-18T14:34:49.124Z"),
"updated_at": ISODate("2024-12-18T14:34:49.124Z"),
"reviews_count": 0
}
]);

Expand Down Expand Up @@ -1060,7 +1071,7 @@ db.getCollection(process.env.ORDER_COLLECTION).insertMany([
"start_leasing": ISODate("2024-12-18T15:00:00Z"),
"end_leasing": ISODate("2024-12-20T15:00:00Z"),
"price": 130.0,
"client": ObjectId("6762d6d9f6292fe72b752b5f"),
"client": ObjectId("6762d6ebf6292fe72b752b60"),

"delivery_type": "to_door",
"delivery_state": "delivered",
Expand All @@ -1080,7 +1091,7 @@ db.getCollection(process.env.ORDER_COLLECTION).insertMany([
"start_leasing": ISODate("2024-12-18T16:34:15.069Z"),
"end_leasing": ISODate("2025-01-01T15:00:00Z"),
"price": 11050.0,
"client": ObjectId("6762d6d9f6292fe72b752b5f"),
"client": ObjectId("6762d6ebf6292fe72b752b60"),

"delivery_type": "to_door",
"delivery_state": "delivered",
Expand Down Expand Up @@ -1172,7 +1183,7 @@ db.getCollection(process.env.REVIEW_COLLECTION).insertMany([

"toolId": ObjectId("6762dc34d5595612f0a2120d"),

"reviewerId": ObjectId("6762d6a2f6292fe72b752b5e"),
"reviewerId": ObjectId("6762d6d9f6292fe72b752b5f"),

"rating": 5,
"date": ISODate("2024-12-26T10:00:00Z"),
Expand All @@ -1183,7 +1194,7 @@ db.getCollection(process.env.REVIEW_COLLECTION).insertMany([

"toolId": ObjectId("6762dc15d5595612f0a2120b"),

"reviewerId": ObjectId("6762d6d9f6292fe72b752b5f"),
"reviewerId": ObjectId("6762d6ebf6292fe72b752b60"),

"rating": 4,
"date": ISODate("2024-12-22T10:00:00Z"),
Expand All @@ -1194,7 +1205,7 @@ db.getCollection(process.env.REVIEW_COLLECTION).insertMany([

"toolId": ObjectId("6762dc27d5595612f0a2120c"),

"reviewerId": ObjectId("6762d6d9f6292fe72b752b5f"),
"reviewerId": ObjectId("6762d6ebf6292fe72b752b60"),

"rating": 5,
"date": ISODate("2024-12-22T10:00:00Z"),
Expand All @@ -1216,7 +1227,7 @@ db.getCollection(process.env.REVIEW_COLLECTION).insertMany([

"toolId": ObjectId("6762dca1d5595612f0a21217"),

"reviewerId": ObjectId("6762d6d9f6292fe72b752b5f"),
"reviewerId": ObjectId("6762d6ebf6292fe72b752b60"),

"rating": 4,
"date": ISODate("2025-01-02T15:00:00Z"),
Expand Down

0 comments on commit a393b1d

Please sign in to comment.