Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixed gfsOpen when opening by docid

  • Loading branch information...
commit f1802302c430a141cd721dd6fad4c6162975285d 1 parent 07ed070
Sergej Jurečko authored April 15, 2010

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  mongoapi.erl
6  mongoapi.erl
@@ -139,7 +139,7 @@ batchInsert(LRecs) ->
139 139
 %  Documents with i between 2 and 5: Mong:find(#mydoc{i = {in, {gt, 2}, {lt, 5}}}, undefined, 0,0).
140 140
 %  in example:     Mong:find(#mydoc{tags = {in, [2,3,4]}}, undefined, 0,0).
141 141
 %  exists example: Mong:find(#mydoc{tags = {exists, false}}, undefined, 0,0).
142  
-%  Advanced query options: gt,lt,gte,lte, ne, in, nin, all, size, exists,'not'
  142
+%  Advanced query operators: gt,lt,gte,lte, ne, in, nin, all, size, exists,'not'
143 143
 %  Possible regex options: "ilmsux" -> IN THIS SEQUENCE! (not all are necessary of course)
144 144
 % 	i 	 case-insensitive matching
145 145
 %	m 	multiline: "^" and "$" match the beginning / end of each line as well as the whole string
@@ -492,8 +492,8 @@ gfsOpen(R) ->
492 492
 gfsOpen([_|_] = Col, R) ->
493 493
 	gfsOpen(list_to_binary(Col),R);
494 494
 gfsOpen(Collection, R) ->
495  
-	case R#gfs_file.docid of
496  
-		undefined ->			
  495
+	case true of
  496
+		_ when R#gfs_file.docid == undefined; R#gfs_file.length == undefined; R#gfs_file.md5 == undefined ->			
497 497
 			Quer = #search{ndocs = 1, nskip = 0, criteria = mongodb:encode_findrec(R)},
498 498
 			case mongodb:exec_find(Pool,name(<<Collection/binary, ".files">>), Quer) of
499 499
 				not_connected ->

0 notes on commit f180230

Please sign in to comment.
Something went wrong with that request. Please try again.