Mongo DB not returning the API Back

I have been trying to solve a query but there are some problems in it.

I have been using a database tool MongoDB and now am having troubles sending API via the selects fields limiting query.

Here’s the code,

 // 4) Field Limiting
    if (req.query.fields) {
      const fields = req.query.fields.split(',').join(' ');
      query =;
    } else {
      query ='-_v');

    const tours = await query;

      status: 'success',
      result: tours.length,
      data: {
  } catch (err) {
      status: 'failed',
      message: err

it is showing something like this,

so it’s sending the API back,

someone please help…

I have been using VS Code as a code editor and Postman software for testing APIs