Giter Site home page Giter Site logo

Comments (3)

kirankumarkolli avatar kirankumarkolli commented on July 18, 2024

Currently cosmos db doesn't support hybrid addressing.
In most scenarios name based approach will work. Are you running into any issues?

from azure-cosmos-python.

HussainMir avatar HussainMir commented on July 18, 2024

It's nice that Cosmos DB gives us the flexibility to use both types of addressing, so I thought it would
Was trying to handle this scenario where I've a database self link and collection id as follows,
`def DeleteCollectionIfExists(client, database_link, collection_id):
try:
collection_link = "dbs/{0}".format(DATABASE_ID) + "/" + 'colls/{0}'.format(collection_id)
#collection_link = database_link + 'colls/{0}'.format(collection_id)
# having some trouble with this format of querying, raised an issue
# #106

    client.DeleteCollection(collection_link)
    print('Collection with id \'{0}\' was deleted'.format(collection_id))
except errors.DocumentDBError as e:
    if e.status_code == 404:
        pass
    elif e.status_code == 400:
        print("Bad request for collection link", collection_link)
        raise
    else:
        raise`

So, do you suggest to follow name based approach only? As we can't toggle between these two approaches not so easily.

from azure-cosmos-python.

southpolesteve avatar southpolesteve commented on July 18, 2024

Closing this issue due to age. Active development of our Python SDK has moved to https://github.com/Azure/azure-sdk-for-python. We have also released 4.0 which includes many updates and new features. If this issue still needs our attention, please reopen it in the new repository.

from azure-cosmos-python.

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.