Skip to content

Commit

Permalink
Merge branch 'Routeur'
Browse files Browse the repository at this point in the history
  • Loading branch information
loicBRAVO committed Feb 5, 2024
2 parents 8478437 + bfe25d8 commit 7f27582
Show file tree
Hide file tree
Showing 10 changed files with 659 additions and 16 deletions.
11 changes: 11 additions & 0 deletions back/dist/models/Message.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// Message.js becomes Message.ts
const mongoose = require("mongoose");
const messageSchema = new mongoose.Schema({
user: String,
text: String,
timestamp: { type: Date, default: Date.now },
});
const Message = mongoose.model("Message", messageSchema);
exports.default = Message;
8 changes: 4 additions & 4 deletions back/init-mongo.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ db.createCollection("messages", {
validator: {
$jsonSchema: {
bsonType: "object",
required: ["conversationId", "messages"],
required: ["messages"],
properties: {
conversationId: {
bsonType: "objectId",
},
// conversationId: {
// bsonType: "objectId",
// },
messages: {
bsonType: "array",
items: {
Expand Down
Loading

0 comments on commit 7f27582

Please sign in to comment.