code: def query_ddo():
      
      assert isinstance(request.json, dict), 'invalid payload format.'
      data = request.json
      assert isinstance(data, dict), 'invalid `body` type, should be formatted as a dict.'
      if 'query' in data:
          search_model = QueryModel(query=data.get('query'), sort=data.get('sort'),
                                    offset=data.get('offset', 100),
                                    page=data.get('page', 1))
      else:
          search_model = QueryModel(query={}, sort=data.get('sort'),
                                    offset=data.get('offset', 100),
                                    page=data.get('page', 1))
      query_result = dao.query(search_model)
      for i in query_result[0]:
          _sanitize_record(i)
      response = _make_paginate_response(query_result, search_model)
      return Response(json.dumps(response, default=_my_converter), 200,
                      content_type='application/json')
docs: Get a list of DDOs that match with the executed query.
      ---
      tags:
        - ddo
      consumes:
        - application/json
      parameters:
        - in: body
          name: body
          required: true
          description: Asset metadata.
          schema:
            type: object
            properties:
              query:
                type: string
                description: Query to realize
                example: {"value":1}
              sort:
                type: object
                description: Key or list of keys to sort the result
                example: {"value":1}
              offset:
                type: int
                description: Number of records per page
                example: 100
              page:
                type: int
                description: Page showed
                example: 1
      responses:
        200:
          description: successful action