Skip to content

Instantly share code, notes, and snippets.

@gaurav-singh1990
Last active December 30, 2016 13:23
Show Gist options
  • Save gaurav-singh1990/6a18f153b173994b8fb97092471615ae to your computer and use it in GitHub Desktop.
Save gaurav-singh1990/6a18f153b173994b8fb97092471615ae to your computer and use it in GitHub Desktop.
# slow query observable
count_patient_subject = Rx::Observable.start(
lambda {
collection.aggregate(aggregate_query)
},
context,
Rx::DefaultScheduler.instance
)
# fast query observable
find_patient_subject = Rx::Observable.start(
lambda {
collection.find({}, { projection: {name:1}}).limit(5)
},
context,
Rx::DefaultScheduler.instance
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment