SSPkrolik / nimongo

Pure Nim lang MongoDB driver
http://sspkrolik.github.io/nimongo
MIT License
101 stars 20 forks source link

Synchronous API should be deprecated/removed. #61

Open yglukhov opened 5 years ago

yglukhov commented 5 years ago

It is distracting, useless, untested, and can lure some users into using it, and migrating from sync to async takes some time, so why not start with async in the first place. Oh, also it is a maintenance burden :)

timotheecour commented 5 years ago

just saw your post after submitting https://github.com/SSPkrolik/nimongo/issues/63 ; for the maintenance (+ testing) burden, https://github.com/SSPkrolik/nimongo/issues/63 could help

timotheecour commented 5 years ago

@yglukhov how would I translate this to async?

  for ai in mc.find(query).limit(2).items():
    echo ai

EDIT: see https://github.com/SSPkrolik/nimongo/pull/57/commits/3ada6cdaf9719cdf5d9f14a428c5e0fc1170acd0 for my approach to this