How to obtain data other than query conditions when querying data by mongoose/mongodb

is to create a data table of contacts, and then the front end searches the corresponding friends through its own username and traverses to the page

this is my mongoose schema

var contactSchema = new Schema({
user1:{
    type:Object,
    required:true
},
user2:{
    type:Object,
    required:true
},
created_time:{
    type:String,
    default: () => moment(new Date()).format("YYYY-MM-DD")
},
},
{
versionKey: false 
})

this is the interface for Node.js to store data

router.post("/agree/apply",function(req,res,next){
console.log(req.body)

new Contact({
    
}).save(function(error,result){
    if(error){
        console.log(error)
    }
    //console.log(result)
    res.json("yes")

})
})

I want to save user1name user1photo and user2name user2photo to the data table, how to write schema. Then how to write the conditions when querying the data, that is, to obtain username and photo in addition to the conditions (their own username)


db.xxx.find({username:{$ne:my_user_name}})
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e87c69-e88.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e87c69-e88.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?