I want to get the list of documents but i am getting undefined

client.query(
            q.map_(
                q.lambda_("x",
                          q.let({
                              "accommodation": q.get(q.var('x')),
                              "accommodation_type": q.if_(
                                  q.is_ref(q.select(['data', 'accommodation_type'], q.var('accommodation'))),
                                  q.get(q.select(['data', 'accommodation_type'], q.var('accommodation'))), None),
                          },
                              {
                                  "id": q.select(['ref', 'id'], q.var('accommodation'), None),
                                  "sku": q.select(['data', 'sku'], q.var('accommodation'), None),
                                  "description": q.select(['data', 'description'], q.var('accommodation'), None),
                                  "accommodation_type": q.if_(q.is_null(q.var('accommodation_type')), None,
                                                              q.select(['data', 'name'], q.var('accommodation_type'), None)),
                                  "accommodation_type_id": q.if_(q.is_null(q.var('accommodation_type')), None,
                                                                 q.select(['ref', 'id'], q.var('accommodation_type'), None)),
                                  "price": q.select(['data', 'price'], q.var('accommodation'), None),
                                  "images": q.select(['data', 'images'], q.var('accommodation'), None),
                                  "capacity": q.select(['data', 'available_spots'], q.var('accommodation'), None),
                                  "available_spots": get_total_available_spots(
                                      q.select(['data', 'available_spots'],
                                      q.var('accommodation'), 0),
                                      q.select(['data', 'sku'], q.var('accommodation'), None),
                                      q.if_(q.is_null(q.var('accommodation_type')), None,
                                      q.select(['data', 'name'], q.var('accommodation_type'), None))),
                                  "createdAt": q.select(['data', 'createdAt'], q.var('accommodation'), None),
                                  "updatedAt": q.select(['data', 'updatedAt'], q.var('accommodation'), None),
                              })
                          ),
                q.paginate(
                    q.match(q.index('accommodations_by_sku'), sku),
                    size=100000
                )
            )
        )
ErrorData(code='invalid expression', description=\"Variable 'accommodation' is not defined.\", position=['count', 'paginate', 'terms', 0, 'from'], failures=None)

Hi @bgreat and welcome!

The error you provided include count a the start of the “path”. That indicates that the error is for a different query. Do you have another query in your application that starts with the Count FQL function? (q.count in the python driver)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.