objectory 0.5.5

  • README.md
  • Installing
  • Versions
  • 60

##Objectory - object document mapper for server-side and client side Dart applications ##Update: Please consider that library as unsuppoprted and not in active developement. Current updates (>0.3.22 published to pub) are mostly suited for usage in concrete scenario of internal project.

Objectory provides typed, checked environment to model, save and query data persisted on MongoDb.

Objectory provides identical API for server side and browser applications (both Dartium and dart2js supported).

Build Status ###Getting started

Now you may run server-side blog example: /example/console/blog_console.dart. This example uses connection to free MongoLab account

  • Install MongoDb locally. Ensure that MongoDB is running with default parameters (host, port 27017, authentication disabled)

Now you may run server side objectory tests: test/base_objectory_tests.dart and test/vm_implementation_tests.dart

  • While running local MongoDB process, start websocket objectory server: bin/objectory_server.dart

  • Configure Dartium launches for test/objectory_test.html and /example/blog.html In group Dartium settings uncheck Run in checked mode and Enable debugging.

Now you may run browser tests and blog example (port of server-side example to browser) both in Dartium and as JavaScript. JavaScript launches do not require any special setup.

See Quick tour and API documentation for futher information

See also Sample full stack application with

  • Angular.dart as primary framework
  • MongoDb as backend DB
  • Objectory as object/document mapper
  • Rikulo Stream Web server to serve static content and as a container for Objectory WebSocket handler.

#Recent change notes


  • Loosing type annotation - _id field can be something another then ObjectId. Use assertions for consistent usage of one type for _id fields across objectory application.
  • Objectory cache separated by collections
  • Objectory cache made private, added public methods clearCache(Type classType) and addToCache(PersistentObject obj)


  • DbRefs removed. Pointers to linked objects use Manual pointers (plain ObjecId). That now works only for simplest case (ObjectId in property of top level object). List of pointers, pointers inside of embedded objects, and inside list of embedded objects are broken for now. To support it new schema properties should be auto-generated


  • Property descriptors in autogenerated Schema classes. Label attribute


  • Several backward incompatible things (To be described)


  • Remove export directive for external dependenvies (bson and dart:async)


  • Domain model autogeneration from simple proto-model (models are backward compatible)
  • Autogeneration of helper schema classes, for safe fields choosing for find and findOne queries
  • Examples and test adopted for new features


  • Fix for issue 65. Added test testPersistentListWithEmbeddedObjects


  • BugFix in ObjectoryServerImpl, objectory server port changed in samples and tests to avoid conflict with pub serve


  • Update core dependencies to 0.10.0 and up


  • bugfix in ObjectoryServerImpl. Addressed issue 64


  • get method added to objectory collection
  • Objectory addToCache method made private
  • Quick tour somewhat updated
  • Changelog moved to root in accordance with pub site preferences
  • some refactoring in objectory initialization
  • fetch method of PersistentObject returns future of itself now
  • previously deprecated method dbType on PersistenObject removed
  • isFetched getter added to PersistentObject (false for shallow proxy)


  • Bug fix: PersistentObject map setter was setting id to null
  • Name change: Objectory datamapDecorator renamed to dataMapDecorator
  • dataListDecorator added to Objectory
  • Package prepared to Dart 1.0


  • Upgrade for Dart SDK version Gwt_Contacts sample is broken, waiting for fix in original dart-polyhmer-dart-examples


  • Port of polymer GwtContacts sample added
  • Bugfix to PersistentObject save method
  • Many minor changes
  • dbType deprecated, use collectionName instead.


  • Added datamapDecorator property to Objectory, so PersistentObject's data map may be substituted by arbitrary map-like object upon creation. For example Web-UI application may configure Objectory to make PersistenObject observable by: objectory.datamapDecorator = (Map map)=>toObservable(map);


  • Bugfix and test for situation when save operation on PersistentObject without dirty fields (should be no-op) actually set all its properties to null


  • Bugfix for issue https://github.com/vadimtsushko/objectory/issues/52. Case added in tests
  • Tests refactored


  • Objectory now use field level updates (update with $set operator) by default. This shoud greatly reduses problems with concurrent updates. Old mode can be toggled by attribute useFieldLevelUpdate


-Small changes in query builder. Better error handling in open connection (pull requests from kaisellgren and izaera respectively)


  • Small changes, bugfixes in query builder


  • Bugfix for remove operation in objectory_server (was not implemented)


  • Upgrade for bson 0.1.5. json_ext dependenvy removed.


  • Query API supports AND and OR operators


  • Bugfix in WebSocket VM implementation.


  • Modelling API revamped. Classes in modelling designated by Type not by string names.
  • Querying API revamped, more closely followed to mongo_db and mongo_dart patterns.


  • PersistentObject got getPersistentList method as preferred way to define List properties in models.


  • match in QueryBuilder go named instead of positional parameters
  • where in QueryBuilder deprecated in favour of jsQuery
  • range in QueryBuilder deprecated in favour of inRange
  • test for match added
  • test for jsQuery added


  • Client/Server communication moved from JsonExt to Bson (using new cross-platform version of bson)
  • Bugfix on browser side - findOne still was using cache.


  • Change in dependencies - bson library separated from within mongo_dart


  • Upgrade to Dart SDK version
  • find() and findOne() always get objects from Db (If objects exists in cache they are replaced by fresh ones from Db)


  • PersistentList inherit from ListBase. No more notimplemented methods and type warnings.


  • Upgrade for Dart SDK version (post M4)


  • Count() method implemented on all platforms


  • Upgrade for M4 changes
  • Obectory server now does not log messages my default, verbosity switched by command line parameter --verbose


  • Bugfixes for PersistentObject methods: contains, indexIf, lastIndexOf
  • save and remove methods returns Future (consistently with Objectory save and return)
  • supported Dart SDK version


  • Support of dart:io version 2. (Stream-based).
  • fetchLinks method of QueryBuilder (With it PersistentObjects in resultset of findOne and find prefetch linked objects)


  • Support for near and within geospatial queries in QueryBuilder (Thanks to Jesse https://github.com/FreakTheMighty)


  • Support for limit and skip operation in QueryBuilder.


  • Ready for M3, run in version 0.3.1_r17328


  • dart.js bootstrap file is moving to pub


  • Minor fixes
  • Cleared all warnings from DartEditor
  • Pubspec refers to dart_mongo from pub.dartlang.org
  • Local_objectory_tests broken due to lawndart errors.


  • minor fixes
  • sdk dependencies changed to pub.dartlang.org


  • Changes reflecting dart lib changes - methods to getters, such as Map.getKeys() and so on

1. Depend on it

Add this to your package's pubspec.yaml file:

  objectory: "^0.5.5"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:objectory/objectory.dart';
Version Uploaded Documentation Archive
0.5.5 Oct 1, 2016 Go to the documentation of objectory 0.5.5 Download objectory 0.5.5 archive
0.3.22 Dec 10, 2014 Go to the documentation of objectory 0.3.22 Download objectory 0.3.22 archive
0.3.21 Jun 22, 2014 Go to the documentation of objectory 0.3.21 Download objectory 0.3.21 archive
0.3.20 Jun 19, 2014 Go to the documentation of objectory 0.3.20 Download objectory 0.3.20 archive
0.3.19 Jun 11, 2014 Go to the documentation of objectory 0.3.19 Download objectory 0.3.19 archive
0.3.18 May 2, 2014 Go to the documentation of objectory 0.3.18 Download objectory 0.3.18 archive
0.3.16 May 2, 2014 Go to the documentation of objectory 0.3.16 Download objectory 0.3.16 archive
0.3.15 Jan 18, 2014 Go to the documentation of objectory 0.3.15 Download objectory 0.3.15 archive
0.3.14 Nov 9, 2013 Go to the documentation of objectory 0.3.14 Download objectory 0.3.14 archive
0.3.13 Nov 2, 2013 Go to the documentation of objectory 0.3.13 Download objectory 0.3.13 archive

All 40 versions...


This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • tool failures on Jan 21, 2018
  • Dart: 2.0.0-dev.15.0
  • pana: 0.10.0


Describes how popular the package is relative to other packages. [more]
41 / 100
Code health derived from static analysis. [more]
91 / 100
Reflects how tidy and up-to-date the package is. [more]
59 / 100
Overall score:
Weighted score of the above. [more]


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:objectory/objectory.dart.


  • Fix lib/src/objectory_query_builder.dart.

    Strong-mode analysis of lib/src/objectory_query_builder.dart failed with the following error:

    line: 49 col: 3
    Invalid override. The type of 'ObjectoryQueryBuilder.and' ('(ObjectoryQueryBuilder) → ObjectoryQueryBuilder') isn't a subtype of 'SelectorBuilder.and' ('(SelectorBuilder) → SelectorBuilder').

  • Fix lib/src/objectory_direct_connection_impl.dart.

    Strong-mode analysis of lib/src/objectory_direct_connection_impl.dart failed with the following error:

    line: 71 col: 3
    Invalid override. The type of 'ObjectoryDirectConnectionImpl.remove' ('(PersistentObject) → Future<dynamic>') isn't a subtype of 'Objectory.remove' ('(BasePersistentObject) → Future<dynamic>').

  • Fix further 3 Dart files.

    Similar analysis of the following files failed:

    • lib/src/objectory_shelf_handler.dart
    • lib/src/http_client.dart
    • lib/src/http_client_io.dart
  • Fix issues reported by dartanalyzer.

    dartanalyzer reported 3 error(s) and 0 warning(s).

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use objectory.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.10.0 <2.0.0
browser ^0.10.0 0.10.0+2
console_log_handler ^0.2.1 0.2.3 0.5.7
http ^0.11.3 0.11.3+16
logging ^0.11.2 0.11.3+1
logging_handlers ^0.8.0 0.8.0
mongo_dart 0.2.9 0.2.9 0.3.1
mongo_dart_query ^0.2.0 0.2.2 0.3.0
quiver ^0.21.4 0.21.4 0.28.0
shelf ^0.6.5 0.6.8 0.7.2
shelf_cors ^0.2.1 0.2.1
Transitive dependencies
async 1.13.3 2.0.3
bson 0.2.0 0.3.0
charcode 1.1.1
collection 1.14.5
convert 2.0.1
crypto 2.0.2+1
fixnum 0.10.6
http_parser 3.1.1
intl 0.15.2
matcher 0.12.1+4
more 1.8.1
path 1.5.1
source_span 1.4.0
stack_trace 1.9.1
stream_channel 1.6.3
string_scanner 1.0.2
typed_data 1.1.5
uuid 0.5.3
Dev dependencies
args ^0.13.4
hop ^0.27.0
stream ^1.5.3
test ^0.12.0