Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
API Toucan
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Damien Armillon
API Toucan
Commits
f5d1cc58
Commit
f5d1cc58
authored
Feb 20, 2022
by
Inès Yeterian
Browse files
Options
Downloads
Patches
Plain Diff
try to add new model
parent
ce7adb9a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
backend/models/modelToucan.js
+19
-1
19 additions, 1 deletion
backend/models/modelToucan.js
backend/models/modelToucanD.js
+0
-18
0 additions, 18 deletions
backend/models/modelToucanD.js
with
19 additions
and
19 deletions
backend/models/modelToucan.js
+
19
−
1
View file @
f5d1cc58
...
...
@@ -10,4 +10,22 @@ var toucanSchema = new Schema ({
date
:
{
type
:
Date
,
required
:
true
},
});
module
.
exports
=
mongoose
.
model
(
"
Toucan
"
,
toucanSchema
);
\ No newline at end of file
// La date doit être unique
toucanSchema
.
index
({
date
:
-
1
},{
unique
:
true
});
const
toucanModele
=
mongoose
.
model
(
"
Toucan
"
,
toucanSchema
);
var
toucanDSchema
=
new
Schema
({
title
:
{
type
:
String
,
required
:
true
},
// Chaque toucan doit avoir un titre et une date
date
:
{
type
:
Date
,
required
:
true
},
issue
:
{
type
:
Number
,
required
:
true
},
urlId
:
{
type
:
String
,
required
:
true
}
});
// Le numéro doit être unique
toucanDSchema
.
index
({
issue
:
-
1
},{
unique
:
true
});
const
toucanDModele
=
mongoose
.
model
(
"
ToucanD
"
,
toucanDSchema
);
module
.
exports
=
{
toucanModele
,
toucanDModele
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
backend/models/modelToucanD.js
deleted
100644 → 0
+
0
−
18
View file @
ce7adb9a
var
mongoose
=
require
(
"
mongoose
"
);
var
Schema
=
mongoose
.
Schema
;
/**
* Indique ce que l'on doit trouver dans un toucan
*/
var
toucanDSchema
=
new
Schema
({
title
:
{
type
:
String
,
required
:
true
},
// Chaque toucan doit avoir un titre et une date
date
:
{
type
:
Date
,
required
:
true
},
issue
:
{
type
:
Number
,
required
:
true
},
urlId
:
{
type
:
String
,
required
:
true
}
});
// Le numéro doit être unique
toucanDSchema
.
index
({
issue
:
-
1
},{
unique
:
true
});
module
.
exports
=
mongoose
.
model
(
"
ToucanD
"
,
toucanDSchema
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment