From 8eed75d7830d9c2ec06b4f5138b9b42fb33a8e09 Mon Sep 17 00:00:00 2001 From: Yury Ershov Date: Sun, 10 Sep 2023 17:39:32 +1000 Subject: [PATCH] patterns/bson: Support for multiple documents per file (#156) * 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 --- patterns/bson.hexpat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/patterns/bson.hexpat b/patterns/bson.hexpat index 8ca8d3cd..53caf770 100644 --- a/patterns/bson.hexpat +++ b/patterns/bson.hexpat @@ -3,6 +3,7 @@ #pragma MIME application/bson +#include #include enum Type : u8 { @@ -128,4 +129,4 @@ struct Document { padding[1]; }; -Document document @ 0x00; \ No newline at end of file +Document documents[while(!std::mem::eof())] @ 0x00 [[inline]];