Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3683

Why Postman and mongoDb db.getCollectionNames return empty array?

$
0
0

I have a spring boot application connecting to a local mongoDB database. When I try to fetch all records from a collection it returns an empty array.

Facture.class

import org.springframework.data.annotation.Id;import org.springframework.data.mongodb.core.mapping.Document;@Document(collection = "Facture")public class Facture {    @Id    private Long id_facture;    private int num_facture;    private double prix;    private String methode_paiement;

FactureRepository

import com.app.Model.Facture;import org.springframework.data.mongodb.repository.MongoRepository;import org.springframework.stereotype.Repository;@Repositorypublic interface FactureDao extends MongoRepository<Facture, Long> {}

Postman results

{"timestamp": "2020-03-25T00:56:13.597+0000","status": 404,"error": "Not Found","message": "No message available","path": "/api/v1/all"}

Viewing all articles
Browse latest Browse all 3683

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>