mormot2 tbsonwriter
uses mormot.db.nosql.bson, mormot.core.base;
procedure TForm2.Button1Click(Sender: TObject); begin var bw: TBSONWriter := TBSONWriter.Create(TRawByteStringStream); bw.BSONWrite('sql', 'select * from tunit'); bw.BSONWrite('tablenum', 12); bw.BSONWrite('bool', True); var s: RawByteString; bw.ToBSONDocument(s); Memo1.Text := s; end;