cosmosdb / labs Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Task 3 creates serializer errors.
PS C:\Users\sasever\Documents\cosmos\cosmoswslab3> dotnet run
Unhandled Exception: Newtonsoft.Json.JsonSerializationException: Error converting value "["Swim Club","Culinary Club"]" to type 'System.String[]'. Path 'clubs', line 1, position 122. ---> System.ArgumentException: Could not cast or convert from System.String to System.String[].
at Newtonsoft.Json.Utilities.ConvertUtils.EnsureTypeAssignable(Object value, Type initialType, Type targetType)
at Newtonsoft.Json.Utilities.ConvertUtils.ConvertOrCast(Object initialValue, CultureInfo culture, Type targetType)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
--- End of inner exception stack trace ---
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property,
JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
at Microsoft.Azure.Documents.QueryResult.Convert(Type type)
at Microsoft.Azure.Documents.QueryResult.AsTypeT
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
at Microsoft.Azure.Documents.Client.FeedResponseBinder.Convert[T](FeedResponse1 dynamicFeed) at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) at Microsoft.Azure.Documents.Linq.DocumentQuery
1.d__31.MoveNext()
at cosmoswslab3.Program.
In technical_deep_dive/02-creating_multi_partition_solution.md, when iterating over the foodInteractions, there's a reference to foodInteractions.IndexOf(interaction). With the included references, this won't compile. It may be a reference to Infer.NET or some other set of extensions methods on IEnumerable. However, when I look in the solution file in this repo, I see that the reference to the IndexOf method was removed altogether. Seems like the documented code should build and match the solution file.
Though the last composite index query worked (i.e. SELECT * FROM c ORDER BY c.foodGroup DESC, c.manufacturerName ASC
), I suspect the last key-value pair at the ent of the Adding a Composite Index section should be "order": "descending"
.
For clarity, the JSON for the indexing policy configuration should be:
{
"indexingMode": "consistent",
"automatic": true,
"includedPaths": [
{
"path": "/manufacturerName/*"
},
{
"path": "/foodGroup/*"
}
],
"excludedPaths": [
{
"path": "/*"
},
{
"path": "/\"_etag\"/?"
}
],
"compositeIndexes": [
[
{
"path": "/foodGroup",
"order": "ascending"
},
{
"path": "/manufacturerName",
"order": "ascending"
}
],
[
{
"path": "/foodGroup",
"order": "descending"
},
{
"path": "/manufacturerName",
"order": "descending"
}
]
]
}
In technical_deep_dive/02-creating_multi_partition_solution.md the phrase in part III that says "Observe the code in the ExecuteLogic method." seems misplaced.
in https://github.com/CosmosDB/labs/blob/master/technical_deep_dive/02-creating_multi_partition_solution.md
The benchmark app failed to open the client with a Microsoft.Azure.Documents.ServiceUnavailableException
Removing the ConnectionPolicy fixed the problem
lab 4: Troubleshooting and Tuning Azure Cosmos DB Requests, Task 3 Import Lab Data Into Collection.
The Transaction blob object is not there. Error in ADF
The required Blob is missing. ContainerName:
https://cosmoslabs.blob.core.windows.net/transactions, ContainerExist: True, BlobPrefix: , BlobCount: 0.. Activity ID:ce038f6f-4d23-4e14-a25a-3f6ac1592e5c
Can we run SQL queries while we subscribed Cosmos db instance for gremlin api? I want to do a case insensitive comparison for strings on Cosmos db gremlin instance but this feature is available only on SQL api of Cosmos.
In Java Labs, download links of Java 8 (or greater) JDK and JRE are pointed to Java Download page in OTN (Oracle Technology Network).
According to Oracle Technology Network License Agreement for Oracle Java SE, indeed downloading JDK/JRE from this page and using them are valid in case of personal study purpose.
But I'm wondering if download link to http://jdk.java.net/ or Azul is better. Furthermore, as Java 8 is out of public update, I'm afraid that Microsoft should recommend using the latest non-LTS or LTS JDK/JRE.
In the pre-lab setup, the PowerShell script provisions >22k RUs. This has a cost of ~$1.80/hr. Provisioned RUs should be revised or instructions at least warning of this cost potential.
The Technical Deep Dive lab is broken due to recent changes in Cosmos DB where all Collections are now required to have a Partition Key.
https://cosmosdb.github.io/labs/technical_deep_dive/05-troubleshooting_failed_requests.html
When .NET Core 3 is generally available, you should be able to update the .NET labs to remove the step where you set the LangVersion
property in the project configuration file. That was required since the asynchronous Main feature came after the release of .NET Core 2.
I kept getting errors running .\labSetup.ps1
on no. 6 of the setup instructions. At the top of the stacktrace was this:
New-AzResource : MissingSubscriptionRegistration : The subscription is not registered to use namespace 'Microsoft.DocumentDB'. See https://aka.ms/rps-not-found for how to register subscriptions. At ...
So I'll suggest the setup instructions should be updated with a suggestion to register CosmosDB:
Register-AzResourceProvider -ProviderNamespace Microsoft.DocumentDB
Hello,
I have created a Azure Cosmos DB Container 'RouteZipcodes' container. It will have json documents with each route and zipcodes that each route is serving. Below is the sample data stored in cosmos DB
{ "id": "2347z3e8-850d-364a-92d2-4fcae2fa5642", "routeName": "THORN1", "zips": [ { "zipCode": "80373" }, { "zipCode": "80371" }, { "zipCode": "80020" }, { "zipCode": "80370" }, { "zipCode": "80021" }, { "zipCode": "80040" }, { "zipCode": "80602" }, { "zipCode": "80372" } ], "status": "A", }
If I execute below query from portal, I am getting result
Query - SELECT r.routeName as routeName FROM routeZipcodes r JOIN rz in r.zips where rz.zipCode = "80602"
Result -
[ { "routeName": "THORN1" } ]
I am trying to run same query from Spring boot app, and am not getting any result. Below is my respository
`
@Repository
public interface RouteZipcodesRepository extends CosmosRepository<RouteZipcodes, String> {
Optional<RouteZipcodes> findById(String id);
Optional<List<RouteZipcodes>> findByHubName(String hubName);
Optional<RouteZipcodes> findByRouteName(String routeName);
// @Query("SELECT r.routeName FROM routeZipcodes r JOIN rz in r.zips where rz.zipCode = \"@zipcode\"")
// String findByZipCode (@Param("zipcode") String zipcode);
@Query("SELECT r.routeName as routeName FROM routeZipcodes r JOIN rz in r.zips where rz.zipCode = \"@zipcode\"")
List<IRouteNameByZipcode> findByZipCode (@Param("zipcode") String zipcode);
}
`
other methods are working as expected. Only query written with @query is not giving results when the same was working in portal.
Can some one please tell me what mistake am I doing.
In the link https://cosmosdb.github.io/labs/dotnet/labs/02-load_data_with_adf.html#create-azure-cosmos-db-database-and-container Exercise 2 .the ADF copy pipeline not running as the blob SAS URL is expired or incorrect .Can you fix this
Since non partitioned tables are not available anymore this lab material should be updated.
document data
{
"family":[
{
"familyId":"123",
"children":[
{
"childId":"123-1"
}
]
}
}
@Repository public interface FamilyRepository extends CosmosRepository<Family, String>{ List<Family> findByFamilyIdChildrenChildId(String familyId,String childId); }
I am getting a blank list while using the above method to fetch the data.
pom depedency:-
com.azure.spring
azure-spring-boot-starter-cosmos
3.1.0
The Azure Cosmos DB Query Playground doesn't work for a long period of time.
Are there any plans to restore it?
Lab 2, Exercise 1 : Task 3, Step 12.
Unable to get the json.
Unhandled Exception: Microsoft.Azure.Cosmos.CosmosException: Response status code does not indicate success: 400 Substatus: 1001 Reason: (Microsoft.Azure.Documents.BadRequestException: Message: {"Errors":["PartitionKey extracted from document doesn't match the one specified in the header"]}
No matter what approach I take, no matter how much I research, I still am getting this error. I updated to the latest nuget package for CosmosDB, still getting this error.
I cannot continue the lab without this step.
The current student.json files seems not be a readable text format. The previous commit of this file seems to be fine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.