Known issues
|
This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics. |
This page describes issues where FQL functions do not behave as intended in various situations. These are all issues that we intend to fix, but the solutions may take some time.
Dates and Times
-
We claim support for ISO 8601 time and date formats, but the library that we use does not, in fact, support all variations of ISO 8601.
Sets
-
When you attempt to
Paginatea set composed with one (or more) of the set functions, such asIntersection, an estimator uses the page size to guess how many items to fetch from the set for manipulation. When the page size is too small to reach far enough into the set, the result may contain far fewer entries than expected. Increasing the page size can often improve the results. -
The
Joinfunction does not behave well with reversed indexes. You might try usingUnioninstead.For example, the following query uses the
Joinfunction to combine the result of the documents in theproducts_by_storeindex with the reverse-sorted results from theinventory_by_productindex:Paginate( Join( Match( Index('products_by_store'), Ref(Collection('stores'), '301') ), Lambda( ['name', 'description', 'price'], Match(Index('inventory_by_product'), Var('name')) ) ), { size: 2 } )This returns 2 results, including an
aftercursor that points to the entry that would start the next page of results:{ after: [ 100, 'Organic, 1 bunch', Ref(Collection("products"), "208"), Ref(Collection("products"), "208") ], data: [ [ 1000, 'Conventional Hass, 4ct bag', Ref(Collection("products"), "204") ], [ 1000, 'Conventional, 1 ct', Ref(Collection("products"), "205") ] ] }However, when the next page of results are fetched using the
aftercursor, the results are reset to the first page:Paginate( Join( Match( Index('products_by_store'), Ref(Collection('stores'), '301'), ), Lambda( ['name', 'description', 'price'], Match(Index('inventory_by_product'), Var('name')) ) ), { size: 2, after: [ 100, 'Organic, 1 bunch', Ref(Collection("products"), "208"), Ref(Collection("products"), "208") ] } ){ before: [ 100, 'Organic, 1 bunch', Ref(Collection("products"), "208"), Ref(Collection("products"), "208") ], after: [ 100, 'Organic, 1 bunch', Ref(Collection("products"), "208"), Ref(Collection("products"), "208") ], data: [ [ 1000, 'Conventional Hass, 4ct bag', Ref(Collection("products"), "204") ], [ 1000, 'Conventional, 1 ct', Ref(Collection("products"), "205") ] ] }To work around the issue, the same query can be rewritten using the
Unionfunction:Paginate( Let( { product_set: Match( Index("products_by_store"), Ref(Collection("stores"), "301") ), products_page: Select( "data", Paginate(Var("product_set"), { size: 100000 }) ), leaf_sets: Map( Var("products_page"), Lambda( ["name", "description", "price"], Match(Index("inventory_by_product"), Var("name")) ) ) }, Union(Var("leaf_sets")) ), { size: 2 } ){ after: [ 100, 'Organic, 1 bunch', Ref(Collection("products"), "208"), Ref(Collection("products"), "208") ], data: [ [ 1000, 'Conventional Hass, 4ct bag', Ref(Collection("products"), "204") ], [ 1000, 'Conventional, 1 ct', Ref(Collection("products"), "205") ] ] }With this approach, paginating over the next page(s) of results works as expected:
Paginate( Let( { product_set: Match( Index("products_by_store"), Ref(Collection("stores"), "301") ), products_page: Select( "data", Paginate(Var("product_set"), { size: 100000 }) ), leaf_sets: Map( Var("products_page"), Lambda( ["name", "description", "price"], Match(Index("inventory_by_product"), Var("name")) ) ) }, Union(Var("leaf_sets")) ), { size: 2, after: [ 100, 'Organic, 1 bunch', Ref(Collection("products"), "208"), Ref(Collection("products"), "208") ] } ){ before: [ 100, 'Organic, 1 bunch', Ref(Collection("products"), "208"), Ref(Collection("products"), "208") ], after: [ 30, 'Conventional, 16 oz bag', Ref(Collection("products"), "207"), Ref(Collection("products"), "207") ], data: [ [ 100, 'Organic, 1 bunch', Ref(Collection("products"), "208") ], [ 50, 'Organic, 16 oz bag', Ref(Collection("products"), "206") ] ] }