• Stars
    star
    102
  • Rank 335,584 (Top 7 %)
  • Language Pascal
  • License
    MIT License
  • Created almost 14 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Delphi MongoDB driver

Delphi MongoDB Driver

A Delphi driver to access a mongoDB server. It uses jsonDoc.pas to store JSON documents. IJSONDocument maps variables onto Delphi variables of type Variant, which resembles the loose typing of JavaScript. There are three main units and two main classes to enable access to a mongo DB server:

jsonDoc.pas

Declares IJSONDocument and related interfaces, and the JSON function to create instances, optionally populated with data. IJSONDocument instances hold the data of a 'document', the basic unit of data mongoDB works with. A variable of type Variant can hold an interface reference to an instance, which enables embedding documents. Use Variant arrays (or IJSONArray) to store arrays of values in a document.

See also https://github.com/stijnsanders/jsonDoc#jsondoc

bsonTools.pas

Declares the LoadBSON and SaveBSON procedures.

Also declares the IBSONDocArray interface which can improve processing arrays of embedded documents by keeping a reference to the underlying data stream, and only loading one document at a time, possibly re-using allocated memory for the same keys if the documents have a similar structure. Attention: take care to keep the TStream instance in existance for as long as you're planning to use the linked IBSONDocArray instance. Failure to do so can lead to privileged instruction or access violation errors.

mongoWire.pas

Use an object of class TMongoWire to connection to a mongoDB server. It supports getting single items, performing inserts, updates and deletes.

Use objects of class TMongoWireQuery to query to a mongoDB server. It handles the cursor and subsequent requests to the server to get more data when needed.

mongoID.pas

Use function mongoObjectId to construct a new MongoDB-style id value.

mongoAuth3.pas

Use procedure MongoWireAuthenticate to authenticate a newly connected TMongoWire instance. As of version 3.0 MongoDB uses a slightly modified SCRAM-SHA-1 to vastly improve security with access control. (Use mongoAuth.pas for MongoDB versions prior to 3.0.)

mongoStream.pas

Use TMongoStream to load and store files in MongoDB. Internally .files and .chunks collections are used to store the data.

examples

See the example projects for straight-forward demonstration applications that use TMongoWire.

More Repositories

1

xxm

Combine Delphi and HTML code in the same source files to compile a website into a library that runs on IIS, Apache httpd, CGI, SCGI, on http.sys or raw no-frills HTTP...
Pascal
60
star
2

TSQLite

Delphi SQLite3.dll wrapper
Pascal
53
star
3

DelphiProtocolBuffer

Delphi Protocol Buffer parser
Pascal
42
star
4

jsonDoc

JSON object for Delphi based on IUnknown and Variant
Pascal
27
star
5

tools

All kinds of handy tools for personal (frequent!) use
Pascal
20
star
6

strato

An attempt at a programming language without reserved words.
Pascal
18
star
7

TRedisWire

Delphi Redis connector
Pascal
18
star
8

feeder

A simple RSS/Atom feed reader, just the way I like it (and hope you do to).
Pascal
14
star
9

tx

tx is a tool to keep track of things.
Pascal
12
star
10

DataLank

It's not quite a data link.
Pascal
12
star
11

TRethinkDB

Delphi RethinkDB driver
Pascal
8
star
12

dparse

Object Pascal Parser
Pascal
7
star
13

TCouchDB

Delphi CouchDB connector
Pascal
4
star
14

WikiEngine

WikiEngine.dll is a library with COM-objects to create and manage a wiki-website, or use 'wiki technology' in an application. WikiSyntax is parsed using a WikiParseXML definition. Data is stored in a database of choice.
Pascal
4
star
15

pdfweb

Proof-of-concept of a dynamic website with PDF documents
Pascal
4
star
16

ro

Ro IRC client
Pascal
3
star
17

primes

An attempt at a performant Eratosthenes's Sieve in Delphi
Pascal
3
star
18

amud

Another Multi User Dungeon
Pascal
1
star
19

RE

Regular Expression, a visual data transformation tool leveraging the power of, among other things, regular expressions.
C#
1
star
20

plasm

Play Assembler
HTML
1
star