Skip to content

Commit

Permalink
patterns/bson: Support for multiple documents per file (#156)
Browse files Browse the repository at this point in the history
* BSON support multiple documents per file

BSON files can contain consecutive documents glued one after another. An example of these is MongoDB FTDC metrics export.

[`bsondump`](https://github.com/mongodb/mongo-tools/blob/master/bsondump/bsondump.go) can unpack this type of BSON documents.

* Add accidentally deleted lines
  • Loading branch information
ershov authored Sep 10, 2023
1 parent 81f4978 commit 8eed75d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion patterns/bson.hexpat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#pragma MIME application/bson

#include <std/mem.pat>
#include <type/time.pat>

enum Type : u8 {
Expand Down Expand Up @@ -128,4 +129,4 @@ struct Document {
padding[1];
};

Document document @ 0x00;
Document documents[while(!std::mem::eof())] @ 0x00 [[inline]];

0 comments on commit 8eed75d

Please sign in to comment.