UNPKG

flexbiz-server

Version:

Flexible Server

3 lines (2 loc) 741 B
'use strict';const assfindhashSchema=new Schema({id_app:{type:String,required:!0,maxlength:1024},creator:{type:String,required:!0},id:{type:Number,required:!0},hash:{type:String,required:!0},previousHash:String,timestamp:Number,data:String,difficulty:Number,nonce:Number,date_created:{type:Date,default:Date.now}}); (global.configs||{}).createIndexes&&(assfindhashSchema.index({id_app:1}),assfindhashSchema.index({creator:1}),assfindhashSchema.index({date_created:1}),assfindhashSchema.index({id:1}),assfindhashSchema.index({hash:1}),assfindhashSchema.index({id_app:1,id:1},{unique:!0}),assfindhashSchema.index({previousHash:1}));const model=mongoose.models.assfindhash||mongoose.model("assfindhash",assfindhashSchema);module.exports=model;