Index: library/mongodb/nx-mongo.tcl =================================================================== diff -u -ra5bf2874a6cb0338860062dce1846279c1704444 -ra24e1f836c3126d0a0e9467bde3a9fa8da901711 --- library/mongodb/nx-mongo.tcl (.../nx-mongo.tcl) (revision a5bf2874a6cb0338860062dce1846279c1704444) +++ library/mongodb/nx-mongo.tcl (.../nx-mongo.tcl) (revision a24e1f836c3126d0a0e9467bde3a9fa8da901711) @@ -13,15 +13,15 @@ # the specified classes, no subclasses allowed # todo: extend the query language syntax, e.g. regexp, ... # todo: handle remove for non-multivalued embedded objects -# idea: handle names of nx objects (e.g. attribute like __name) -# idea: handle classes von nx objects (e.g. attribute like __class) +# idea: handle names of nx objects (e.g. property like __name) +# idea: handle classes von nx objects (e.g. property like __class) # idea: combine incremental slot operations with e.g. add -> $push, remove -> $pull # todo: make "embedded", "reference" spec even nicer? namespace eval ::nx::mongo { ::nx::Object create ::nx::mongo::db { - :attribute db + :property db :public method connect {{-db test} args} { set :db $db set :mongoConn [::mongo::connect {*}$args] @@ -35,10 +35,10 @@ } ####################################################################### - # nx::mongo::Attribute is a specialized attribute slot + # nx::mongo::Attribute is a specialized property slot # - ::nx::MetaSlot create ::nx::mongo::Attribute -superclass ::nx::Attribute { - :attribute mongotype + ::nx::MetaSlot create ::nx::mongo::Attribute -superclass ::nx::VariableSlot { + :property mongotype :protected method init {} { # @@ -171,7 +171,7 @@ ::nsf::var::set $value __embedded_in [list $s $name] ::nsf::var::set $s __contains($value) 1 } else { - error "value '$value' for attribute $name is not of type $arg" + error "value '$value' for property $name is not of type $arg" } } # @@ -191,7 +191,7 @@ } ::nsf::var::set $value __referenced_in $refs } else { - error "value '$value' for attribute $name is not of type $arg" + error "value '$value' for property $name is not of type $arg" } } } @@ -207,13 +207,13 @@ # Every mongo class can be configured with a mongo_ns, from which # its instance data is queried. # - :attribute mongo_ns - :attribute mongo_db - :attribute mongo_collection + :property mongo_ns + :property mongo_db + :property mongo_collection # # Provide helper methods to access from an external specifier - # (attribute name or operator name) internal representations + # (property name or operator name) internal representations # (eg. mongo type, or mongo operator). # @@ -236,7 +236,7 @@ # For interaction with bson structures, we provide on the class # level "bson cond" (a small dsl for a more convenient syntax in # bson queries), "bson query" (combining conditions with - # ordering), "bson atts (a simplifed attribute selection) and + # ordering), "bson atts (a simplifed property selection) and # "bson parameter" which translates from a bson structure (tuple) # into a dashed parameter list used in object creation. # @@ -336,10 +336,10 @@ } # - # Overload method attribute to provide "::nx::mongo::Attribute" as a + # Overload method property to provide "::nx::mongo::Attribute" as a # default slot class # - :public method attribute {spec {-class ::nx::mongo::Attribute} {initblock ""}} { + :public method property {spec {-class ::nx::mongo::Attribute} {initblock ""}} { regsub -all {,type=} $spec {,arg=} spec next [list $spec -class $class $initblock] } @@ -350,7 +350,7 @@ :public method index {att {-type 1} args} { if {![info exists :mongo_ns]} {:mongo_setup} # todo: 2nd index will need a different type - # todo: multi-attribute indices + # todo: multi-property indices db index ${:mongo_ns} [list $att int $type] {*}$args } @@ -475,9 +475,9 @@ ::nx::Class create ::nx::mongo::Object { # - # _id is the special attribute maintained by mongoDB + # _id is the special property maintained by mongoDB # - :attribute _id -class ::nx::mongo::Attribute { + :property _id -class ::nx::mongo::Attribute { set :mongotype oid }