MongOData
MongOData copied to clipboard
The specified type for the complex property is not a complex type.
When I connect to one of my Mongo databases, I get this error when trying to call the data service:
Here's the stack trace:
at DataServiceProvider.DSPMetadata.AddComplexProperty(ResourceType resourceType, String name, ResourceType complexType)
at Mongo.Context.MongoMetadataCache.AddComplexProperty(ResourceType resourceType, String propertyName, ResourceType propertyType)
at Mongo.Context.MongoMetadata.AddDocumentProperty(MongoContext context, String collectionName, ResourceType collectionType, String propertyName, BsonElement element, Boolean isCollection)
at Mongo.Context.MongoMetadata.AddResourceProperty(MongoContext context, String collectionName, ResourceType collectionType, BsonElement element, Boolean treatObjectIdAsKey)
at Mongo.Context.MongoMetadata.RegisterResourceProperty(MongoContext context, ResourceType resourceType, BsonElement element)
at Mongo.Context.MongoMetadata.RegisterDocumentProperty(MongoContext context, ResourceType resourceType, BsonElement element)
at Mongo.Context.MongoMetadata.UpdateResourceSet(MongoContext context, ResourceSet resourceSet, BsonDocument document)
at Mongo.Context.MongoMetadata.PopulateMetadataFromCollection(MongoContext context, String collectionName, ResourceSet resourceSet)
at Mongo.Context.MongoMetadata.PopulateMetadata(MongoContext context)
at Mongo.Context.MongoMetadata..ctor(String connectionString, Metadata metadata)
at Mongo.Context.MongoDataServiceBase2.<.ctor>b__1(String x) at Mongo.Context.MongoDataServiceBase
2..ctor(String connectionString, MongoConfiguration mongoConfiguration)
at Mongo.Context.Queryable.MongoQueryableDataService..ctor(String connectionString, MongoConfiguration mongoConfiguration)
at MongODataTest.MongoDataService..ctor() in c:\Projects\Sandbox\MongODataTest\MongODataTest\MongoDataService.cs:line 12
at CreateMongODataTest.MongoDataService()
at System.ServiceModel.Dispatcher.InstanceProvider.GetInstance(InstanceContext instanceContext, Message message)
at System.ServiceModel.Dispatcher.InstanceBehavior.GetInstance(InstanceContext instanceContext, Message request)
at System.ServiceModel.InstanceContext.GetServiceInstance(Message message)
at System.ServiceModel.Dispatcher.InstanceBehavior.EnsureServiceInstance(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
I was able to connect to a different database, but the one I want the most throws this error.
Thoughts?
Hi, Here's the code that raises the exception:
if (complexType.ResourceTypeKind != ResourceTypeKind.ComplexType) { throw new ArgumentException("The specified type for the complex property is not a complex type."); }
It's hard to say what kind of data might cause this but perhaps you can debug it find out.
Looks like it's failing on the Lease property:
Viewing with Robomongo:
Do you have a small database that you can share so I could try to reproduce the issue?
Here's a mongodump of the database and collection I'm trying to get data from.
https://db.tt/SvN1qH6x
Thanks, I will have a look at it.
Any luck?
Sorry, didn't have time to investigate yet (was busywith work and other open source project). Hope to check this out in the next few days.
Hello again, I believed the issue is fixed now, pushed in the package 1.3.0. Please have check it out.