Files
purple-explorer/models/tx.js
T

17 lines
584 B
JavaScript
Raw Normal View History

2019-05-27 10:33:22 -07:00
var mongoose = require('mongoose')
, Schema = mongoose.Schema;
var TxSchema = new Schema({
txid: { type: String, lowercase: true, unique: true, index: true},
vin: { type: Array, default: [] },
vout: { type: Array, default: [] },
2020-11-23 15:33:54 -07:00
total: { type: Number, default: 0, index: true },
timestamp: { type: Number, default: 0, index: true },
blockhash: { type: String, index: true },
blockindex: {type: Number, default: 0, index: true},
2019-05-27 10:33:22 -07:00
}, {id: false});
2020-11-23 15:33:54 -07:00
TxSchema.index({total: 1, total: -1, blockindex: 1, blockindex: -1});
2019-05-27 10:33:22 -07:00
module.exports = mongoose.model('Tx', TxSchema);