Skip to content
This repository has been archived by the owner on Jun 23, 2020. It is now read-only.

Changes #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Changes #5

wants to merge 6 commits into from

Conversation

yayajacky
Copy link

Call callback when operations are done, closes db, and add only, exept support

My use case is that the db I am dumping from has 5 collections, and 2 of them are big and unneeded.

@boutell
Copy link
Member

boutell commented Jun 1, 2015

Hmm, this looks good... a few concerns.

  1. The callback should always be last. "opt" should come before callback.
    You can use arguments.length to permit people to skip passing opt.
  2. The "only" and "except" mechanisms depend on indexOf in a way that will
    do the wrong thing if a collection name happens to be a substring of an
    unrelated collection's name. That would need to be fixed.
  3. Closing the stream is a bc break, but since we're still in the 0.x
    series, that's OK. We'll need to document this change in the README and in
    its changelog section, and we'll need to bump the minor version number (not
    just the patchlevel).
  4. It sounds like you are not using this to pipe standard input and output;
    you're writing to sockets or other blocking things. The code works for you
    because node is willing to buffer as many calls to write() as you want, but
    it's certainly going to be a RAM issue at some point. We should think about
    waiting for "drain" events if write() returns false, indicating that
    buffering is taking place.

On Fri, May 29, 2015 at 7:08 PM, Jack Yeh [email protected] wrote:

Call callback when operations are done, closes db, and add only, exept
support

My use case is that the db I am dumping from has 5 collections, and 2 of

them are big and unneeded.

You can view, comment on, or merge this pull request online at:

#5
Commit Summary

  • Call callback when operations are done, closes db, and add only,
    except support

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#5.

*THOMAS BOUTELL, *DEV & OPS
P'UNK AVENUE | (215) 755-1330 | punkave.com

@boutell
Copy link
Member

boutell commented Jun 1, 2015

(The reason item number 4 didn't come up for me is that standard output is
actually blocking in node. Weird but true.)

On Mon, Jun 1, 2015 at 10:27 AM, Tom Boutell [email protected] wrote:

Hmm, this looks good... a few concerns.

  1. The callback should always be last. "opt" should come before callback.
    You can use arguments.length to permit people to skip passing opt.
  2. The "only" and "except" mechanisms depend on indexOf in a way that will
    do the wrong thing if a collection name happens to be a substring of an
    unrelated collection's name. That would need to be fixed.
  3. Closing the stream is a bc break, but since we're still in the 0.x
    series, that's OK. We'll need to document this change in the README and in
    its changelog section, and we'll need to bump the minor version number (not
    just the patchlevel).
  4. It sounds like you are not using this to pipe standard input and
    output; you're writing to sockets or other blocking things. The code works
    for you because node is willing to buffer as many calls to write() as you
    want, but it's certainly going to be a RAM issue at some point. We should
    think about waiting for "drain" events if write() returns false, indicating
    that buffering is taking place.

On Fri, May 29, 2015 at 7:08 PM, Jack Yeh [email protected]
wrote:

Call callback when operations are done, closes db, and add only, exept
support

My use case is that the db I am dumping from has 5 collections, and 2 of

them are big and unneeded.

You can view, comment on, or merge this pull request online at:

#5
Commit Summary

  • Call callback when operations are done, closes db, and add only,
    except support

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#5.

*THOMAS BOUTELL, *DEV & OPS
P'UNK AVENUE | (215) 755-1330 | punkave.com

*THOMAS BOUTELL, *DEV & OPS
P'UNK AVENUE | (215) 755-1330 | punkave.com

@yayajacky
Copy link
Author

Sure, I was writing db into a single file and loading it back from a single file.

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

Successfully merging this pull request may close these issues.

2 participants