Package com.codename1.backend.mongo


package com.codename1.backend.mongo

A MongoDB client speaking the wire protocol (OP_MSG) directly, with SCRAM-SHA-256 authentication and TLS.

MongoClient opens and pools connections; MongoCollection has the CRUD operations. Documents are Maps -- Bson keeps their key order, which MongoDB requires of a command -- holding strings, numbers, booleans, java.util.Date, byte[], ObjectId, lists and nested maps. Filters and Updates build the query and update documents.

Not supported: mongodb+srv:// seed lists (they need DNS SRV lookups this runtime does not have; list the hosts instead), replica-set failover (the first host that answers is used for everything), SCRAM-SHA-1, X.509 and Kerberos authentication, sessions and multi-document transactions.

  • Class
    Description
    BSON, the binary document format MongoDB stores and speaks.
    A Decimal128 value, kept as the sixteen little-endian bytes the server sent: this runtime has no BigDecimal to decode it into.
    Builds query filter documents.
    A pool of connections to one MongoDB deployment.
    One collection: the CRUD operations, as MongoDB's own commands.
    One database of a MongoClient.
    A command MongoDB answered with ok: 0, or a write it reported failed.
    A MongoDB object identifier: twelve bytes, a four-byte timestamp first.
    Builds update documents; Updates.combine(Map...) merges several into one.