[WeChat Mini Program 7] Cloud Database: Use Field to obtain the value of the specified field.

1. Field description

        Collection. field (projection: Object): Collection
        support: applet, cloud function, Web

        Specify the fields to be returned for the records in the returned results

        Parameter
                projection: Object

        The description
                method accepts a required object to specify the fields to be returned. Each key of the object indicates the fields to be returned or not to be returned. The value passed in true|false (or 1|-1) indicates whether to return or not to return.

2. How to use

        The structure of the winning bid in the database:

 

According to the where query, specify the conditions, and according to the field query, return the value of the required field.

 

Obtained results:

 

Guess you like

Origin blog.csdn.net/m0_60318025/article/details/131260549