# -*- tcl -*-
#
# This is a sample test set using the low-level (pure tcl) interface
# for inserting and querying tuples into MongoDB.
#

package require nsf
package require nx::test
package require nsf::mongo


#nsf::configure debug 2
#
# One might query the resulting tuples from the mongo shell via:
#
#    mongo
#    > use tutorial
#    > db.persons.find();
#

? {set mongoConn [::mongo::connect]} "mongoc_client_t:0"
puts "Connection: $mongoConn"

? {set mongoColl [::mongo::collection::open $mongoConn tutorial persons]} "mongoc_collection_t:0"
puts "Collection: $mongoColl"
puts PERSONS=[::mongo::collection::query $mongoColl {}]

? {set mongoColl [::mongo::collection::open $mongoConn tutorial z]} "mongoc_collection_t:1"
puts "Collection: $mongoColl"
puts Z=[::mongo::collection::query $mongoColl {}]
