Git Product home page Git Product logo

Comments (3)

apetenchea avatar apetenchea commented on July 21, 2024 1

Hello @sha-eln!

Sorry for the delay in responding to your issue, we truly appreciate your patience. Our team has been heavily occupied with other tasks.

In ArangoDB, creating and deleting collections are operations that can't be done inside a transaction. Transactions are designed to provide atomicity and isolation to data manipulation operations (like insert, update, delete) on existing collections, rather than structural changes to the database itself (like creating or deleting collections).

If you need to empty a collection (i.e., delete all documents but keep the collection itself), you should be able to do that using a truncate operation:

db = client.db(DB_NAME , username=DB_USER, password=DB_PASSWORD)
collection = db.collection(COLL_NAME)
collection.truncate()

Lastly, while you can truncate a collection inside a transaction, it's important to note that if truncation is all you're doing, a transaction is not necessary. Transactions are typically used to ensure atomicity of multiple interdependent operations.

from python-arango.

apetenchea avatar apetenchea commented on July 21, 2024

Dear @sha-eln,

I believe my answer clears some of the confusion regarding transactions. Therefore, I am going to close this issue. In case you experience any problems with our Python driver, don't hesitate to open a new one.

from python-arango.

sha-eln avatar sha-eln commented on July 21, 2024

@apetenchea Thank you so much for your response! Yes that does clear things up quite a bit. Wishing you all the best. :)

from python-arango.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.