I think the real issue is to figure out why they were empty in the first place. When a user is created user:136 object and the entry in users:joindate should be both created.
In this case you will have to run a custom script to add the missing entries. Place the following code in a javascript file name custom_scripts.js in your nodebb folder and run it with node custom_script.js
/* globals require, console, process */
'use strict';
const nconf = require('nconf');
nconf.file({
file: 'config.json',
});
nconf.defaults({
base_dir: __dirname,
views_dir: './build/public/templates',
upload_path: 'public/uploads',
});
const db = require('./src/database');
db.init(async (err) => {
if (err) {
console.log(`NodeBB could not connect to your database. Error: ${err.message}`);
process.exit();
}
await addMissingJoinDates();
console.log('done');
process.exit();
});
async function addMissingJoinDates() {
const batch = require('./src/batch');
const user = require('./src/user');
const total = await db.sortedSetCard('users:joindate');
let counter = 0;
await batch.processSortedSet('users:joindate', async (uids) => {
const userData = await user.getUsersFields(uids, ['uid', 'joindate']);
counter += uids.length;
await db.sortedSetAddBulk(
userData.map(data => ['users:joindate', data.joindate, userData.uid])
);
console.log(`${counter} / ${total}`);
}, {
batch: 500,
});
}