Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Dropping user functions by group prefix is not working #670

Closed
robross0606 opened this issue Jun 17, 2020 · 2 comments
Closed

Dropping user functions by group prefix is not working #670

robross0606 opened this issue Jun 17, 2020 · 2 comments
Labels
Bug A code defect that needs to be fixed. fixed Issue has been resolved but remains open due to a pending release.
Milestone

Comments

@robross0606
Copy link

robross0606 commented Jun 17, 2020

I have a set of user functions:
2020-06-17 13 40 43
From reading the documentation, running this should remove those functions with the provided namespace:

await this.arangodb.dropFunction('NUROCOR::SD', true)

However, after running this function I get this:

ArangoError: no AQL user function with name 'NUROCOR::SD' found
    at new ArangoError (C:\Code\ncp\study-design-service\node_modules\arangojs\lib\async\error.js:71:21)
    at Object.resolve (C:\Code\ncp\study-design-service\node_modules\arangojs\lib\async\connection.js:273:32)
    at callback (C:\Code\ncp\study-design-service\node_modules\arangojs\lib\async\connection.js:139:26)
    at IncomingMessage.<anonymous> (C:\Code\ncp\study-design-service\node_modules\arangojs\lib\async\util\request.node.js:78:21)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (_stream_readable.js:1221:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
  

However, I am using the second option to enable "group" deletion. What am I missing WRT how this API works?

@robross0606
Copy link
Author

robross0606 commented Jun 17, 2020

FYI, I'm currently using this workaround because the "group" option doesn't appear to work:

      const udf = await this.arangodb.listFunctions()
      const removing = []
      for (const fn of udf.result) {
        if (fn.name.startsWith('NUROCOR::SD')) {
          removing.push(this.arangodb.dropFunction(fn.name))
        }
      }
      await Promise.all(removing)

This produces the same expected result.

@pluma
Copy link
Contributor

pluma commented Jun 18, 2020

That's a bug in v6 that will be fixed in v7.

@pluma pluma added the Bug A code defect that needs to be fixed. label Jun 18, 2020
@pluma pluma added this to the v7 milestone Jun 18, 2020
@pluma pluma added the fixed Issue has been resolved but remains open due to a pending release. label Jul 6, 2020
@pluma pluma closed this as completed Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A code defect that needs to be fixed. fixed Issue has been resolved but remains open due to a pending release.
Projects
None yet
Development

No branches or pull requests

2 participants