Sultan
0
Q:

where id and id in mongodb

const p_id = patient_id;
    let fetchingReports = await Reports.aggregate([
      ...(p_id
        ? [
            {
              $match: {
                createdBy: mongoose.Types.ObjectId(id),
                patient_id: p_id,
              },
            },
          ]
        : [
            {
              $match: {
                createdBy: mongoose.Types.ObjectId(id),
              },
            },
0

New to Communities?

Join the community