<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          pebongoMongoDB 的 Delphi 驅(qū)動

          聯(lián)合創(chuàng)作 · 2023-09-30 19:10

          pebongo 是 MongoDB 數(shù)據(jù)庫的 Delphi 驅(qū)動接口。

          示例代碼:

          //example #2 on bsonspec.org
          var
            bson              : TBSONDocument;
            item              : TBSONArrayItem;
          begin
            bson := TBSONDocument.Create;
            item := TBSONArrayItem.Create;
            item.Items[0] := TBSONStringItem.Create( 'awesome' );
            item.Items[1] := TBSONDoubleItem.Create( 5.05 );
            item.Items[2] := TBSONIntItem.Create( 1986 );
            bson.Values['BSON'] := item;
            bson.SaveToFile( ExtractFilePath( Application.ExeName ) + 'hello.bson' );
            bson.Free;
          //preliminary driver interface
          var
            mongo             : TMongoConnection;
            coll              : TMongoCollection;
            cursor            : TMongoCursor;
            i                 : integer;
          begin
            mongo := TMongoConnection.Create;
            memo1.lines.add( booltostr( mongo.Connected, true ) );
            mongo.GetDatabase( 'tesdb' );
            coll := mongo.GetCollection( 'things' );
            cursor := coll.find( );
          
            memo1.lines.add( inttostr( cursor.Count ) );
            for i := 0 to cursor.Count - 1 do
              memo1.lines.add( cursor.Result[i].ToString );//print as JSON
          
            cursor.Free;
            coll.Free;
            mongo.Free;
          end;
          瀏覽 22
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  欧洲AV久久无码秘 蜜桃 | 亚洲视频app | 影音先锋每日最新av | 亚洲欧美在线视频一区 | 丁香婷婷激情网 |