Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-927

libbson streaming writer docs are unclear, perhaps misleading

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.3.0-beta0
    • Affects Version/s: None
    • Component/s: Docs, libbson
    • None

      I'm trying to use libbson's streaming interface to write a sequence of records as described in this StackOverflow question. The streaming docs say the following:

      Libbson provides mechanisms to stream BSON documents to and from file-descriptors. This can be convenient if you want to do stream oriented processing.

      I do see that the reader interface, via bson_reader_new_from_file, does allow for reading from a file, but I see no similar interface for writing to a file as the docs suggest.

      My code sample in the SO question shows some working code for writing from the bson_writer_t's buffer, but when dealing with an arbitrary number of sub-documents, this would mean I'd have to use one writer for the entire parent document, meaning the buffer can grow arbitrarily large and undermine the whole point of streaming.

      Are there plans to add file writing support directly to the bson_writer interface as the docs seem to indicate, and if so, would this kind of incremental writing of documents be supported? This seems like a basic requirement for anyone who wants to emit larger documents with nested sub-documents.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            tonycpsu Tony Cebzanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: