cancel
Showing results for 
Search instead for 
Did you mean: 

Infix filters in CAP Node.js not working

carlonnheim
Participant
0 Kudos

Hi,

I am trying to make an infix filter work in a query based on the documentation from capire - Embedded CQL with cds.ql (cloud.sap).

SELECT.from ('Authors', a => {
   a.ID, a.name, a.books (b => {
     b`.*`, b.createdAt`as since`, 
     b.suppliers`[city='Paris']`('*')
   })
})

But when I run that I get this error

TypeError: Cannot read property '_target' of undefined
    at _rewriteExpandAsterisks (/.../node_modules/@sap/cds-runtime/lib/db/generic/rewrite.js:16:35)

I did some tracing and found that the "refs" input parameter of that function, which usually contains an array of referenced entities, instead contains an array of object with the referenced entity in the "id" property. This case is not handled and causes the exception.

Has anyone else had this problem and found a solution for it?

Thanks!

//Carl

View Entire Topic
mariya_yordanova
Explorer
0 Kudos

Hi onnheimc,

the fix will be available in the next cds version 5.4.0 (at the beginning of August).

Best Regards

Maria

carlonnheim
Participant
0 Kudos

Hi mariya.yordanova and david.kunz2 ,

We are trying an upgrade and it seems this issue has come back in CDS6, now it is in the _buildExpandedCQN function of the file @sap/cds/libx/_runtime/db/expand/expandCQNToJoin.js (column references where the column name is packed into the "id" member are not working).

Can you have a look again? Thanks in advance!

//Carl

mariya_yordanova
Explorer
0 Kudos

Hi connheim ,

We have implemented an integration test with an infix filter that is green with CDS6.

Could you please attach an example application reproducing the problem ?

Best Regards

Maria