/**
 * 计数器数据结构
 *
 * @author CaiAoLin
 * @date 2017/6/29
 * @version
 */
import mongoose from "mongoose";

let Schema = mongoose.Schema;
let collectionName = 'counter';
let modelSchema = {
    // 模块名称
    _id: String,
    // 计数器
    sequence_value: {
        type: Number,
        default: 1
    },
};

mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false}));

//两个counter
var counterSchema = new Schema(modelSchema);
mongoose.model("counters", counterSchema);