[CXX-80] Online Array example is not working Created: 19/Feb/13 Updated: 10/Apr/14 Resolved: 13/Mar/14 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | legacy-0.0-26compat-2.6.0-rc2 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Adriaan Bredekamp | Assignee: | Tyler Brock |
| Resolution: | Done | Votes: | 0 |
| Labels: | cxxmove, driver, legacy-cxx, windows | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
C++ with Visual Studio 2010 on Win XP |
||
| Description |
|
Hallo, I am using Mongo 2.08 with Visual C++ 2010 on Win Xp. I need to add very large arrays, up to 6400 datapoints to my database. The data contained represent an FFT result which is then stored along with other data. My problem refers to adding such a large array. I worked through the array example but just adding each value with the "<<" operator of C++ is cumbersome and cout allows only 256 values if I remember correctly. In the array example on mongodb.org the follow lines make an exception vector<be> a = an_obj["x"].Array(); Obviously what is passed to it in the example is not seen as an array. In the other direction the line (Obj to vector conversion) bo myarray = an_obj["x"].Obj(); I am getting as output the exception again and error in the command window stating: It compiles fine but does not run. I think if this could be made to work I should be able to make some progress again. Can someone please check that the array example also actually works? |
| Comments |
| Comment by Githook User [ 12/Mar/14 ] | |||||||||||||||
|
Author: {u'username': u'TylerBrock', u'name': u'Tyler Brock', u'email': u'tyler.brock@gmail.com'}Message: | |||||||||||||||
| Comment by Tyler Brock [ 12/Mar/14 ] | |||||||||||||||
|
Hey Adriaan, I've added a better array example using some of the things I mentioned above to the source code of the repository and we are going to replace the old example that you found on the web with this one. Please let me know if this has helped. | |||||||||||||||
| Comment by Githook User [ 12/Mar/14 ] | |||||||||||||||
|
Author: {u'username': u'TylerBrock', u'name': u'Tyler Brock', u'email': u'tyler.brock@gmail.com'}Message: | |||||||||||||||
| Comment by Githook User [ 12/Mar/14 ] | |||||||||||||||
|
Author: {u'username': u'TylerBrock', u'name': u'Tyler Brock', u'email': u'tyler.brock@gmail.com'}Message: | |||||||||||||||
| Comment by Githook User [ 12/Mar/14 ] | |||||||||||||||
|
Author: {u'username': u'TylerBrock', u'name': u'Tyler Brock', u'email': u'tyler.brock@gmail.com'}Message: | |||||||||||||||
| Comment by Tyler Brock [ 12/Mar/14 ] | |||||||||||||||
| Comment by Tyler Brock [ 04/Mar/14 ] | |||||||||||||||
|
If you'd like to avoid inserting it you can alternatively print it out by calling bob.obj().toString() | |||||||||||||||
| Comment by Tyler Brock [ 04/Mar/14 ] | |||||||||||||||
|
Hi Adriaan, If you want to avoid using the macros you can do something like this to build up the array:
| |||||||||||||||
| Comment by Gary Murakami [ 05/Mar/13 ] | |||||||||||||||
|
Note that this is a C++ driver issue, distinctly different from the C driver. The C++ driver is part of the Core Server, and this issue should probably be moved there. |