<s> import _local_path <EOL> import txmongo <EOL> from txmongo import filter <EOL> from twisted . internet import defer , reactor <EOL> @ defer . inlineCallbacks <EOL> def example ( ) : <EOL> mongo = yield txmongo . MongoConnection ( ) <EOL> foo = mongo . foo <EOL> test = foo . test <EOL> idx = filter . sort ( filter . ASCENDING ( "<STR_LIT>" ) + filter . DESCENDING ( "<STR_LIT>" ) ) <EOL> print "<STR_LIT>" , idx <EOL> result = yield test . create_index ( idx ) <EOL> print "<STR_LIT>" , result <EOL> result = yield test . index_information ( ) <EOL> print "<STR_LIT>" , result <EOL> result = yield test . drop_index ( idx ) <EOL> print "<STR_LIT>" , result <EOL> geoh_idx = filter . sort ( filter . GEOHAYSTACK ( "<STR_LIT>" ) + filter . ASCENDING ( "<STR_LIT:type>" ) ) <EOL> print "<STR_LIT>" , geoh_idx <EOL> result = yield test . create_index ( geoh_idx , ** { '<STR_LIT>' : <NUM_LIT:1> } ) <EOL> print "<STR_LIT>" , result <EOL> result = yield test . drop_index ( geoh_idx ) <EOL> print "<STR_LIT>" , result <EOL> geo_idx = filter . sort ( filter . GEO2D ( "<STR_LIT>" ) ) <EOL> print "<STR_LIT>" , geo_idx <EOL> result = yield test . create_index ( geo_idx , ** { '<STR_LIT>' : - <NUM_LIT:100> , '<STR_LIT>' : <NUM_LIT:100> } ) <EOL> print "<STR_LIT>" , result <EOL> result = yield test . drop_index ( geo_idx ) <EOL> print "<STR_LIT>" , result <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> example ( ) . addCallback ( lambda ign : reactor . stop ( ) ) <EOL> reactor . run ( ) </s>
