-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.js
More file actions
52 lines (40 loc) · 1.13 KB
/
Copy pathTest.js
File metadata and controls
52 lines (40 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// const mongoose = require("mongoose");
// const { Questions, Users, Answer } = require("./Model/Schema");
// mongoose
// .connect(
// "mongodb://127.0.0.1:27017/Test2"
// )
// .then(() => console.log("Connecting to DB....."))
// .catch((e) => console.error("Could not to connect to mongoDB...", e));
// require("./Model/Schema");
// async function SaveQuestion(Content, Type) {
// const Question = new Questions({
// Content,
// Type,
// });
// await Question.save();
// }
// SaveQuestion('How old are you' , ' Text');
// async function CreateUser(Name, Email, phonenumber) {
// const User = new Users({
// Name,
// phonenumber,
// Email,
// });
// await User.save();
// }
// CreateUser('Ahmed' , 'Ahmed@gmail.com' , '011254554');
// async function CreateAnswer(content, userid) {
// const answer = new Answer({});
// await answer.save();
// await answer.update({
// $set: {
// Content: content,
// },
// $push: {
// User: userid,
// },
// });
// }
// let ans = [ {Ques :'64219ab86bae9fd68c8f3a82' , Ans :'25'}];
// CreateAnswer(ans , '64219b2527e32629feecc7d2');