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

Preserve ordering in get_data method? #22

Open
ipcamit opened this issue Jun 1, 2022 · 0 comments
Open

Preserve ordering in get_data method? #22

ipcamit opened this issue Jun 1, 2022 · 0 comments

Comments

@ipcamit
Copy link
Collaborator

ipcamit commented Jun 1, 2022

It seems like client.get_data method sorts the configuration ids, is it possible that it can preserve ordering?

e.g.
If i ask the database to query on a list of configurations, then can it return configurations id in same order without shuffling or sorting?

co_ids = client.get_data(
    'configurations',
    fields='_id',
    query={'_id': {'$in': all_co_ids}},
    ravel=True
).tolist()
print  ( all_co_ids, co_ids)

> (('CO_126997626019_000',
  'CO_388198965408_000',
  'CO_109720559668_000',
  'CO_116236251087_000'),
 ['CO_109720559668_000',
  'CO_116236251087_000',
  'CO_126997626019_000',
  'CO_388198965408_000'])

Is there a way to ensure both output orders above matches?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant