export data from specific date
This commit is contained in:
@@ -16,8 +16,10 @@ module.exports = async function (context) {
|
||||
let written = 0
|
||||
|
||||
let memReplyIds = {}
|
||||
const total = await collection.count()
|
||||
const cursor = collection.find()
|
||||
const fromDate = _.get(context, 'config.define.posts.fromDate')
|
||||
const query = fromDate ? { ts: { $gte: new Date(fromDate) } } : {}
|
||||
const total = await collection.count(query)
|
||||
const cursor = collection.find(query)
|
||||
while (await cursor.hasNext()) {
|
||||
const result = await cursor.next()
|
||||
let posts = await collectPostData(context, result, memReplyIds, false)
|
||||
|
||||
Reference in New Issue
Block a user