Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

outEdges() and inEdges() no longer works on 7.x #704

Closed
robross0606 opened this issue Dec 11, 2020 · 2 comments
Closed

outEdges() and inEdges() no longer works on 7.x #704

robross0606 opened this issue Dec 11, 2020 · 2 comments
Assignees
Labels
Bug A code defect that needs to be fixed.

Comments

@robross0606
Copy link

robross0606 commented Dec 11, 2020

It appears that outEdges() and inEdges() are incorrectly validating the collection against the passed in IDs on 7.x driver.

This Jest unit test fails:

  it('Gets in edges and out edges from Arango', async () => {
    const db = new Database({
      url: config.arangoDb.url,
      databaseName: config.arangoDb.database
    })
    const edgeCollection = await db.createEdgeCollection('links')
    const edgeCollectionData = await edgeCollection.get()
    expect(edgeCollectionData.type).toBe(CollectionType.EDGE_COLLECTION)
    
    await expect(edgeCollection.outEdges('notLinks/test1')).resolves.toBeEmptyArray()
    await expect(edgeCollection.inEdges('notLinks/test1')).resolves.toBeEmptyArray()
  })

The error message is:

Document ID "notLinks/test1" does not match collection name "links"

How are these functions, which are available only on EdgeCollection types, supposed to work now? The entire semantics of the functions rely on the document IDs not matching the edge collection name.

I suspect this is a regression caused by http://arangodb.github.io/arangojs/MIGRATING#cross-collection-operations.

@robross0606 robross0606 changed the title outEdges() and inEdges() no longer works outEdges() and inEdges() no longer works on 7.x Dec 11, 2020
@pluma pluma added the Bug A code defect that needs to be fixed. label Jan 13, 2021
@pluma pluma self-assigned this Jan 13, 2021
@pluma
Copy link
Contributor

pluma commented Jan 13, 2021

Oops, you're right. documentHandle should take a flag to decide whether it should allow foreign collections to support this use case. This also affects edges.

@wilsongoode
Copy link

Having this same issue trying to retrieve in/out edges on a particular document. @robross0606 thank you for the clear issue report! I think I can manage a workaround in my app, but was feeling like I was crazy for expecting the edge collection to be able to reference a document's id. Always good to be able to point to a clear bug rather than a mystery.

@pluma pluma closed this as completed in 855ec02 Mar 24, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug A code defect that needs to be fixed.
Projects
None yet
Development

No branches or pull requests

3 participants