Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query returns empty set when query existing entity with existing (primary key, row key) pair #53

Open
Murphy-OrangeMud opened this issue Aug 18, 2021 · 0 comments

Comments

@Murphy-OrangeMud
Copy link

	entitiesClient := entities.New()
	entitiesClient.Client.Authorizer = storageAuth

	// what is partition key and row key
	input := entities.InsertEntityInput {
		PartitionKey: "abcabc1",
		RowKey: "123acb1",
		MetaDataLevel: entities.NoMetaData,
		Entity: map[string]interface{} {
			"company": "Microsoft",
			"department": "ADG",
		},
	}
	query := entities.QueryEntitiesInput {
		PartitionKey: "abcabc1",
		RowKey: "123acb1",
		MetaDataLevel: entities.NoMetaData,
	}
	if _, err := entitiesClient.Insert(ctx, accountName, tableName, input); err != nil {
		fmt.Printf("Error creating Entity: %s", err)
	}

	qresult, err := entitiesClient.Query(ctx, accountName, tableName, query)
	if err != nil {
		fmt.Printf("Error querying Entity: %s", err)
	}
	fmt.Printf("%v\n %v\n", *(qresult.Response.Response), qresult.Entities)

	return

The result is:

{200 OK 200 HTTP/1.1 1 1 map[Cache-Control:[no-cache] Content-Type:[application/json;odata=nometadata;streaming=true;charset=utf-8] Date:[Wed, 18 Aug 2021 07:43:05 GMT] Etag:[W/"datetime'2021-08-18T07%3A43%3A04.7865159Z'"] Server:[Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0] X-Content-Type-Options:[nosniff] X-Ms-Request-Id:[471b80b6-b002-0002-5b04-947141000000] X-Ms-Version:[2020-08-04]] 0xc0000743c0 -1 [chunked] false false map[] 0xc000492100 0xc0000b6370}
 []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant