These are chat archives for Automattic/mongoose

3rd
Oct 2016
Jonathan
@MaddoxDevelopment
Oct 03 2016 17:12
Mongoose is retuning null when I try to query a simple key, value, and doesn’t throw any errors
any ideas?
 if (!req.query.session) return res.json({ 'error': 'missing session' })
    let ssid : string = req.query.session.toString();
    let results: IUser
    try {
        results = await model.findOne({ sessionID : ssid }).exec()
    } catch(err) {
        console.log(err);
        return res.send(err);
    }
    console.log(results);
Results seems to be null everytime, and no err thrown