Comments (11)
Hi! The main branch is the one that creates the Cosmos DB and fills it with a collection and documents. All of this happens in CosmosDBConnector.cs. Can you check that you use the master branch and that it generates a database and collection? It should also call the method to initialize the data in the retrieveallcookies method, perhaps you can debug that.
from buildingcloudnativesolutions.
I did git clone after clicking on copy and It was on the master branch.
Yes, I have CosmosDBConnector.cs in NationalCookies.Data, I can see the sub
private void InitializeCookies()
{
//define the cookie objects
Cookie cookieChololateChip = new Cookie
{
Id = Guid.NewGuid(),
ImageUrl = "https://intcookie.azureedge.net/cdn/cookie-cc.jpg",
Name = "Chololate Chip",
Price = 1.2
};
Cookie cookieButterCookie = new Cookie
{
Id = Guid.NewGuid(),
ImageUrl = "https://intcookie.azureedge.net/cdn/cookie-bc.jpg",
Name = "Butter Cookie",
Price = 1.0
};
Cookie cookieMacaroon = new Cookie
{
Id = Guid.NewGuid(),
ImageUrl = "https://intcookie.azureedge.net/cdn/cookie-mc.jpg",
Name = "Macaroons",
Price = 0.9
};
//add cookies to Cosmos DB
CreateDocument(this._cookieCollectionName, cookieChololateChip);
CreateDocument(this._cookieCollectionName, cookieButterCookie);
CreateDocument(this._cookieCollectionName, cookieMacaroon);
}
from buildingcloudnativesolutions.
So is it working now?
from buildingcloudnativesolutions.
No, I tried debugging, getting more details on the same finction, I think the error is saying that there is nothing in the DB
from buildingcloudnativesolutions.
While debugging, all code inside the constructor CosmosDBConnector executed but again inside the fucntion
RetrieveAllCookies
that it fails
from buildingcloudnativesolutions.
Mmm, it looks like it is expecting a collection, which isn’t there. Could you throw away the database in Cosmos DB and debug the code in the constructor that creates the database and collection and see if it actually creates a collection
from buildingcloudnativesolutions.
Ok I will drop it but should I remove it from appsettings as well the name of the DB?
from buildingcloudnativesolutions.
No, leave the settings
from buildingcloudnativesolutions.
OK, it created the database but not the collections nor inserted the cookies, what should I eneter for the 2 params
"CosmosDBCookieCollectionName": "",
"CosmosDBOrderCollectionName": "",
from buildingcloudnativesolutions.
Ah, that might be it. Please fill in all values that the app settings file requires. Fill in whatever you like
from buildingcloudnativesolutions.
I entered cookies for the 1st one and orders for the 2nd, yes it created the collections and added the 3 cookies
Thanks for your help
from buildingcloudnativesolutions.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from buildingcloudnativesolutions.