Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gaël de Chalendar
Pkm-api
Commits
cf3a8226
Commit
cf3a8226
authored
May 13, 2020
by
Armand PUCCETTI
Browse files
minor bug correction
parent
0e93e265
Changes
1
Hide whitespace changes
Inline
Side-by-side
insert_doc_files.js
View file @
cf3a8226
...
...
@@ -41,12 +41,13 @@ function case1 (collection,val) {
}
function
case2
(
collection
,
val
)
{
val
=
common
.
normalise
(
val
);
const
norm_
val
=
common
.
normalise
(
val
);
const
{
exec
}
=
require
(
'
child_process
'
);
let
out_val
=
val
+
'
.json
'
;
// let out_val = val + '.json';
console
.
log
(
"
val
"
,
val
);
let
content
=
fs
.
readFileSync
(
val
,
'
utf8
'
);
let
res
=
md2json
.
parse
(
content
);
var
document
=
{
"
filename
"
:
val
,
"
filecontent
"
:
res
};
var
document
=
{
"
filename
"
:
norm_
val
,
"
filecontent
"
:
res
};
// Insert the content into the collection
collection
.
insertOne
(
document
,
function
(
err
,
res
)
{
if
(
err
)
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment