I'm trying to connect next.js app to mongodb via mongoose in _middeware file(./pages/_middleware.ts )
But I get this error on incoming requests:
error - (middleware)\node_modules\mongoose\dist\browser.umd.js (1242:0) #
ReferenceError: regeneratorRuntime is not defined
How can I fix it?
+1 I have the same issue when trying to use in the middleware the instance created for mongoose so I don't have to connect it every time I make a request... but it seems this might not be supported yet.
It appears that it is not possible to use node api calls inside of NextJS middleware as this middleware is executed in the Edge runtime. Mongoose is a Node.js api, hence why is doesn't work.
Edge and Node.js Runtimes
Related
i deployed the neo4j in kubernetes, so when i tried to acess http://:7474/ it show me this error( ServiceUnavailable: WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver.), hoe can i solve it?
You need to uncomment a single line inside $NEO4J_HOME/conf/neo4j.conf:
dbms.connector.bolt.address=0.0.0.0:7687
The issue is well described here
If you're using Neo4j Helm instead of neo4j.conf you will have values.yaml. also it is well described here.
Currently, I'm developing a native application using React-Native. I've decided to go with AWS Amplify because of it's real time updates as well as its authentication.
I also have a Web Application that runs on a Node.js with Epxress server. This web application connects to a Mongo database.
My big problem is that I would like to have all of my aws amplify queries run to my existing MongoDb instead of a new dynamoDb database which is provided with AWS AppSync, but unfortunately I dont know where to start. This is especially helpful in adding authentication easily in my existing web application as well.
My first idea was to just create all my API endpoints in a new node js server and have app sync call to these API end points, but I'm not sure how to implement calling end points on an existing server (and this seems kind of counter intuitive to the 'serverless' idea)
My other idea came from this: Can AWS App-Sync be used without dynamoDB
This states to use AWS Lambda to 'pipeline' my data to the existing mongodb, but I'm not really sure what that entails.
TL;DR - I would like to be able to query an existing Mongodb instead of using DynamoDb when using AWS Amplify with AppSync.
I hope this is clear enough and doesn't sound like I'm rambling. Thanks in advance!
I would suggest using either an HTTP datasource to connect to your MongoDB backend or a Lambda function. Here are a couple getting started tutorials for both:
https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-http-resolvers.html
https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-lambda-resolvers.html
If you go the Lambda route, then you can leverage the new #function feature of the GraphQL Transformer in the Amplify CLI: https://aws-amplify.github.io/docs/cli/graphql#function
I am new to Flutter and Couchbase, trying to connect to a sample bucket travel-sample using fluttercouch plugin, but getting error "unable to set target endpoint to ws//10.0.2.2:8091/travel-sample" for setting endpoint as ws//10.0.2.2:8091/travel-sample. Could some one explain to me what will be the endpoint for me and are there any changes needed else where. I am trying to test the server on the master repository of fluttercouch plugin. Here is the main.dart and bucket overview.
Couchbase Lite (the library underlying FlutterCouch implementation) cannot directly sync with Couchbase Server. A Couchbase Sync Gateway has to be deployed with the next instructions to allow syncing between the server and the mobile database:
"enable_shared_bucket_access": true,
"import_docs": "continuous",
You can find further documentation about Couchbase Sync Gateway in the Couchbase Documentation.
The primary point of confusion is you're trying to connect your fluttercouch plugin directly to Couchbase Server, and it's designed for Couchbase Lite, which is what runs on on a mobile device. I don't have enough experience with flutter to tell you what that endpoint should be, but it looks like you're targeting the wrong thing at the moment.
I need little help for connect my front end angular2 with MongoDB
I have created a form crud and need connect with database MongoDB
Any Idea?
You can not connect Angular2 directly to MongoDB you need to use NodeJs also. There is a course on Udemy which is called Angular2 & Node - The Prectical Guide MEAN Stack. It may help you.
You can connect MongoDB with Angular Application using NodeJs and Express .
You'll need to set up a server with which you'll have to configure your port , etc .
Later you can coonect to your MongoDb either using Mongoose or MongoJs .
Os is Mac Os Maverick.
In a jhipster context (last version, 1.2.2), I get an error when I request the default application on an entity I have just generate using yo jhipster:entity generator.
I run a yo jhipster to create a vanilla application with mongodb as database, java 7 and nothing special.
Then I run grunt build and grunt server for hot reload on the client part and mvn spring-boot:run for the server side app.
When I go to the http://localhost:8080/ url, I get the normal page. I can sign in with either the user or admin login.
I run the yo jhipster:entity foo to get an exemple of rest service in the back end.
When I request for the foo resource with the URL http://localhost:8080/#/foo, I get the page to CRUD the resource as it is said on the jhipster website.
But when I try to create a foo item with the modal form, I get an error on the back end server log ([WARN] org.springframework.web.servlet.PageNotFound - Request method 'POST' not supported).
I can't figure out how to solve this.
Do I miss something in the documentation ?
Do you have any idea, hint ?
I have the same issue using H2 as development database instead of mongodb.
Thanks.
Hervé
This might be due to MongoDB, if you have a date field.
We will release very soon a new and improved Entity sub-generator, which should work better for you. While testing it, I had a serialization issue with MongoDB and a date field, and I corrected it in this new version. This is due to Jackson which can't serialize Joda Time dates (the correct annotations were only generated for SQL databases, not NoSQL databases)