Giter VIP home page Giter VIP logo

labs's People

Contributors

aliuy avatar anfeldma-ms avatar bartlomiejczudekcg avatar ckcampbell248 avatar cosmosdb avatar courtneyandrews avatar devjourney avatar drmcghee avatar falloutxay avatar givenscj avatar luisbosquez avatar lukasz-pyrzyk avatar michaljankowskii avatar nielsophey avatar pmatah avatar seesharprun avatar timsander1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

labs's Issues

Lab 2: Querying an Azure Cosmos DB Database using the SQL API :Error

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.DocumentQuery1.d__31.MoveNext()
at cosmoswslab3.Program.

d__4.MoveNext() in C:\Users\sasever\Documents\cosmos\cosmoswslab3\Program.cs:line 38
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at cosmoswslab3.Program.(String[] args)

IndexOf method not found

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.

Probably a little typo in the Indexing Policy JSON

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"
            }
        ]
    ]
}

Incorrect text in Module 2

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.

Question on Cosmos db gremlin api

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.

JDK/JRE download location in Java Labs

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.

LangVersion in .NET Core projects

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.

Update Instruction to include registration of CosmosDB

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

Data not being fetched with custom query using '@Query' annotation

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.

Not getting data based on child node from query method

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

Lab-08 PartitionKey error

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.