Function fieldsListToMongoProjection

  • Convert fields string array to a mongo projection object

    Returns

    projection object

    Example

    fieldsListToMongoProjection(['field1','field2','field3'])
    // returns { field1: 1, field2: 1, field3: 1 }

    Parameters

    • fieldsList: string[]

      A list of fields in a mongo record

    Returns MongoProjectionObject

Generated using TypeDoc