jschan - Anonymous imageboard software. Classic look, modern features and feel. Works without JavaScript and supports Tor, I2P, Lokinet, etc.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
466 B

5 years ago
'use strict';
const Mongo = require(__dirname+'/db.js')
, db = Mongo.client.db('jschan').collection('captcha');
5 years ago
module.exports = {
db,
5 years ago
findOne: (id) => {
5 years ago
return db.findOne({ '_id': id });
5 years ago
},
insertOne: (text) => {
5 years ago
return db.insertOne({
5 years ago
'text': text,
'expireAt': new Date()
5 years ago
});
},
findOneAndDelete: (id, text) => {
5 years ago
return db.findOneAndDelete({
'_id': id,
'text': text
});
},
5 years ago
deleteAll: () => {
5 years ago
return db.deleteMany({});
5 years ago
},
}