I found a good way to get the user list out of mongodb. In case anyone need it:
async function doMongoDb() { const { MongoClient } = require("mongodb"); const username = encodeURIComponent("admin"); const password = encodeURIComponent("mypassword"); const clusterUrl = "localhost:27017"; const authMechanism = "DEFAULT"; const uri = `mongodb://${username}:${password}@${clusterUrl}/?authMechanism=${authMechanism}`; const client = new MongoClient(uri, { useNewUrlParser: true, useUnifiedTopology: true }); try { await client.connect(); const database = client.db("nodebb"); const objects = database.collection("objects"); // get all user const query = { _key: /^user:\d+$/ }; // select fields we want to see const options = { projection: { _id: 0, username: true, _id: false, email: true, "email:confirmed": true, joindate: true, fullname: true }, }; const cursor = objects.find(query, options); if ((await cursor.count()) === 0) { console.log("No user found!"); } // iterate over the users await cursor.forEach(user => { if (user["email:confirmed"] == 1 ) { console.dir(user); } }); } finally { // make sure we close the connection await client.close(); } } // --------------------------------------------------- function init() { try { doMongoDb(); } catch(e) { console.log(e); } } // --------------------------------------------------- init();How can i get thumbnails picture link in api?
-
another question is where is the button to upload thumbnails topic after allow user to upload thumbnails topic in admin setting
-
You should be able to do that from the composer. It looks like this for me (the one on the right):
It will give you an option to add an image from url or select a file from your computer. -
@oplik0 said in How can i get thumbnails picture link in api?:
You should be able to do that from the composer. It looks like this for me (the one on the right):
It will give you an option to add an image from url or select a file from your computer.yeah i did , it will after upload automatic create thumbnail image from it, Am i correct?, so how can i display that thumbail image in topic list instead of user's avatar
-
It should happen automatically. At least that's how it works for me:
Could you try it with an url instead of uploading a file? -
try both but same result,i have no idea why i just installed today and everythings are running at lastest version