[JAVA-106] rename isn't working Created: 15/Apr/10 Updated: 29/Oct/10 Resolved: 18/May/10 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | 2.0 |
| Fix Version/s: | 2.0 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Mark Waschkowski | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows, java 1.4 driver, mongo 1.3.3 |
||
| Description |
|
if I do: db.requestStart(); then I get: com.mongodb.MongoException: rename failed: { "errmsg" : "assertion: source namespace does not exist" , "ok" : 0.0} at com.mongodb.DBCollection.rename(DBCollection.java:499) which doesn't seem appropriate as namespace should exist, the collection itself exists. If I save something in the code: db.requestStart(); the following is printed: collection name = testCollection the following assertion fails (which shouldn't happen as no exception is thrown) |
| Comments |
| Comment by Mark Waschkowski [ 18/May/10 ] |
|
OK, thanks. |
| Comment by Eliot Horowitz (Inactive) [ 18/May/10 ] |
|
rename() works at the db level, not the java level so in the first case, as far as the db is concerned, the collection doesn't exist in the 2nd case, the DBCollection object will never get changes. I changed rename so it returns the new DBCollection so you can do collection = collection.rename( "newname" ) |