first commit
This commit is contained in:
50
models/colllogging.js
Normal file
50
models/colllogging.js
Normal file
@ -0,0 +1,50 @@
|
||||
const dbkebengkel=require('../config/collections/dbkebengkel');
|
||||
const Schema = dbkebengkel.Schema;
|
||||
|
||||
const moment = require('moment-timezone');
|
||||
const OTLtime = moment.tz(Date.now(), "Asia/Tokyo");
|
||||
// console.log(OTLtime);
|
||||
|
||||
const collschema = Schema({
|
||||
iprequest : {
|
||||
type : String,
|
||||
required : true
|
||||
},
|
||||
timestamp : {
|
||||
type : String,
|
||||
required : true
|
||||
},
|
||||
useragent : {
|
||||
type : String,
|
||||
required : true
|
||||
},
|
||||
contenttype : {
|
||||
type : String,
|
||||
required : true
|
||||
},
|
||||
originalurl :{
|
||||
type : String,
|
||||
required : true
|
||||
},
|
||||
requestbody :{
|
||||
type : String,
|
||||
required : true,
|
||||
},
|
||||
requestheader :{
|
||||
type : String,
|
||||
required : true,
|
||||
},
|
||||
statuscode : {
|
||||
type : String,
|
||||
required : true
|
||||
},
|
||||
response : {
|
||||
type : String,
|
||||
required : true,
|
||||
}
|
||||
// },{collection:"colllogging", timestamps : true});
|
||||
},{collection:"colllogging", timestamps : {
|
||||
currentTime : () => OTLtime
|
||||
}});
|
||||
|
||||
module.exports = dbkebengkel.model('colllogging', collschema);
|
||||
Reference in New Issue
Block a user