So this is my Schema folder:
module.exports = mongoose.model(
'premium',
new mongoose.Schema({
User: String,
Name: String,
Expire: Number,
Permanent: Boolean,
})
);
So I want to get from database only User and Name items and use it in embed on discord.js, but I am not finding any way to do so
CodePudding user response:
You can use select
and specify field you want with 1 and not with 0 :
dbSchemas.SomeValue.find({}).select({ "User": 1, "Name": 1});