[DOCS-1800]  type not supported for appendMinElementForType" , "code" : 10061 Created: 12/Aug/13  Updated: 03/Nov/17  Resolved: 13/Aug/13

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Improvement Priority: Major - P3
Reporter: auto Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Java/MongoDB

Location: http://docs.mongodb.org/manual/tutorial/calculate-distances-using-spherical-geometry-with-2d-geospatial-indexes/
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36
Referrer: http://docs.mongodb.org/manual/core/2d/
Screen Resolution: 1366 x 768
repo: docs
source: tutorial/calculate-distances-using-spherical-geometry-with-2d-geospatial-indexes


Issue Links:
Duplicate
duplicates DOCS-335 Error Message Reference Closed
Participants:
Days since reply: 9 years, 37 weeks, 2 days ago

 Description   

Could not find any documentation ofr these error messages. Hard to understand what's the expected set of values.

{ "location" : { "$near" : [ -40.8 , 45.9] , "$maxDistance" : ".01" , "$type" : "2"}}

com.mongodb.MongoException: error counting :

{ "errmsg" : "exception: type not supported for appendMinElementForType" , "code" : 10061 , "ok" : 0.0}

at com.mongodb.DBCollection.getCount(DBCollection.java:771)
at com.mongodb.DBCursor.size(DBCursor.java:632)
at com.gowonder.test.classes.Testclass.main(Testclass.java:76)

Reporter: deblina
E-mail: deblina.karmakar@synechron.com



 Comments   
Comment by Anne Moroney [ 03/Jun/14 ]

Oops, I See now this is closed as duplicate of ;
DOCS-335 Error Message Reference

Comment by Anne Moroney [ 03/Jun/14 ]

I am also getting this error.

> db.messages.find( { "headers.To":  { $type: 0 } } , {"headers.To": 1, "headers.Message-ID": 1,"headers.X-To": 1, "headers.To.type": 1}).limit(1) //4= array, 10-null, 2=string
error: { "$err" : "type not supported for appendMinElementForType", "code" : 10061 }

Since I'm trying to search, I'm confused about why it thinks I'm trying to append an element.

Research results;
1.
It seems we are hitting this ansi-C method?
https://github.com/mongodb/mongo/blob/master/src/mongo/bson/bsonobjbuilder.h

mongo / src / mongo / bson / bsonobjbuilder.h 
Line 556
        /**
these are the min/max when comparing, not strict min/max elements for a given type
*/
        void appendMinForType( const StringData& fieldName , int type );
        void appendMaxForType( const StringData& fieldName , int type );

2.
Some unit tests are calling it, per Github search,
https://github.com/mongodb/mongo/search?q=appendMaxForType&type=Code
For example;

 src/mongo/bson/bson_validate_test.cpp
Last indexed on May 16
208 209 210 	
b.appendMinForType( buf, i );
sprintf( buf, "bar%d", i );
b.appendMaxForType( buf, i );
... 	
224 225 226 227 	
b.appendMaxForType( buf, i );
}
BSONObj x = b.obj();
ASSERT_OK( validateBSON( x.objdata(), x.objsize() ) );

Generated at Thu Feb 08 07:41:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.